#include <iostream>
using namespace std;

int main()
{
    int n,d,k;
    cin >> n >> d >> k;
    int j[k+1];
    for(int i=0;i<k+1;i++)
    {
        j[i]=d*i+1;
        j[i]=j[i]%n;
        if(j[i]==0){j[i]=n;}
    }
    int sum=0;
    for(int i=0;i<k+1;i++)
    {
        sum+=j[i];
    }
    cout << sum;

    return 0;
}
