#include <iostream>
using namespace std;
int main()
{
    long long n,d,k,sum=0,next=1;
    cin>>n;
    cin>>d;
    cin>>k;
    sum=1+sum;
    k=k-1;
    while(k!=0)
    {
        next=next+d;
        if(next>n)
        {
            next=next-n;
        }
        sum=sum+next;
        k=k-1;
    }
    cout<<sum<<endl;
    return 0;
}