#include<iostream>
using namespace std;
int main(){
int n,d,k;
cin>>n>>d>>k;
int sum=0;
int place=1;
while(k!=-1){
    sum=sum+place;
    place=place+d;
    if(place>n){
        place=place-n;
    }
    k=k-1;
}
cout<<sum;
return 0;
}