#include <iostream>
using namespace std;
int main ()
{
    int n, d, k;
    cin>>n>>d>>k;
    int s = 1, f = 1;
    while (k > 0)
    {
        if (f + d > n && d < n)
        {
            int h = (f + d) - n;
            f = h;
            s = s + f;
            k = k - 1;
        }
        else
        {
            if (d > n)
            {
                int h = d - n;
                f = h;
                s = s + f;
                k = k - 1;
            }
            else
            {
                f = f + d;
                s = s + f;
                k = k - 1;
            }
        }
    }
    if (n = 0)
    {
        cout<<0;
    }
    else 
    {
        cout<<s;
    }
    return 0;
}
