#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--;
    while(k!=0)
    {
        next=next+d;
        if(next>n)
        {
            next=next-n;
        }
        sum=sum+next;
        k--;
    }
    cout<<sum<<endl;
    return 0;
}