#include <iostream>
using namespace std;
int main ()
{
    int chisla,skok,pyti,position = 1;
    int sum = 1;
    cin >> chisla >> skok >> pyti;
    for (int i = 1; i <= pyti; i ++)
    {
    if (skok + position <= chisla)
        { position += skok;
        sum += position;
        }
    else if (skok + position > chisla) 
        {
           if ((position + skok) % chisla == 0)
            {
                position = (position + skok) - chisla;
                sum += position;}
                else {
                position = (position + skok) % chisla;
                sum += position;}
    }
    cout << sum;
    return 0;
}