#include <iostream>
using namespace std;

int main() {

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

    bool table[n];
    table[0] = true;

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

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

        if (!table[pos - 1]) s += pos;
        table[pos - 1] = true;

    }

    cout << s << endl;

    return 0;

}
