#include<iostream>
using namespace std;
int main()
{
    int a;///5
    int b;///3
    int c;///4
    int n=1;
    int d=0;
    int sbor=0;
    cin>>a>>b>>c;

        if(a>=b)
        {

        while(d<=c)
        {
          sbor=sbor+n;
          n=n+b;
          if(n>a)
        {
          n=n-a;
        }
          d=d+1;
        }

        cout<<sbor;
        }




    return 0;
}
