#include<iostream>
using namespace std;
int main()
{
int n,d,k;
cin>>n>>d>>k;
int sumi = 1;
int jump = 1;
for(int i = 1 ;i<=k;i++){
    jump+=d;
    while(jump>n){
        jump = jump-n;
    }
    sumi += jump;

}

cout<<sumi;
}
