#include <iostream>
using namespace std;

int main()
{
    int n,d,k,sum=0,location;
    cin >> n >> d >> k;
    location=1+d;
    if(location>n)
    {
        location=location-n;
    }


    for(int i=0; i<=k; i++)
    {
        location=location+1+d;
        if(location>n)
        {
            location=location-n;
        }
        sum+=location;
    }
    cout << sum << endl;

    return 0;
}


