#include <iostream>
using namespace std;
int main ()
{
    int n, d, k, m = 0, s = 0, w = 1;
    cin >> n >> d >> k;
    while (m <= k)
    {
        m++;
        while (w > n)
        {
            w = w - n;
        }
        s = s + w;
        w = w + d;
    }
    cout << s << endl;
    return 0;
}

