#include <iostream>
using namespace std;
int main ()
{
    int chisla,skok,pyti,position = 1;
    int sum = 1;
    cin >> chisla >> skok >> pyti;
    while (pyti != 0)
    {


    if (skok + position <= chisla)
        { position+= skok;
        sum += position;
        pyti -= 1;
        }
    else if (skok + position > chisla) {position = (position + skok) % chisla;
    sum += position;
    pyti-= 1;}
    }
    cout << sum;
    return 0;
}
