#include <iostream>
using namespace std;

int main() {

    int n, d, k, s = 1, pos = 1;
    cin >> n >> d >> k;

    for (k; k > 0; k--) {

       pos = (pos + d) % n;
       if (pos == 0) pos = n;

       s += pos;

    }

    cout << s;
    return 0;
}
