#include <iostream>
using namespace std;
int main(){
    long long n,d,k,sbor=1,br1,br2=1;
    cin>>n>>d>>k;
    for (br1=1;br1<=k;br1++){
        br2=br2+d;
        if (br2>n){
            br2=br2%n;
        }
        for (br2;br2<=0;br2=br2+n){
        }
        sbor=sbor+br2;
    }
    cout<<sbor;
    return 0;
}

