#include <iostream>
using namespace std;
int main()
{
    int n,d,k,z=1,f=1,i;
    cin >>n>>d>>k;
    for (i=1; i<=k; ++i)
    {
        f=f+d;
        if (f!=n) {f=f%n;}
        z=z+f;
    }
    cout <<z;
    return 0;
}
