#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;///0+1
    place=place+d;
    while(place>n){
    if(place>n){
        place=place-n;
    }
    }
    k=k-1;
}
cout<<sum;
return 0;
}