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

