#include <iostream>
using namespace std;
int main ()
{
    long long n,d,k,sum=1,place=1;
    cin>>n>>d>>k;
    for(int i=1;i<=k;i++){
        place+=d;
        if(place>n){
            place=place-n;
        }
        sum+=place;
    }
    cout<<sum<<endl;

}
