#include <iostream>
using namespace std;

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


