#include <iostream>
using namespace std;

int main () {
    int n, d, k, i = 1, s = 1;
    cin >> n >> d >> k;
    while(k > 0){
        i += d;
        if(i > n){
            i -= n;
        }
        s += i;
        k--;
    }
    cout << s;

    return 0;
}
