#include using namespace std; int main(void){ long long A,B,C; cin >> A >> B >> C; long long block = A + B - 1; long long i = 0; for(;C >= block;i += A) { C -= block; } cout << C < C) { cout << i + C; } else { cout << i + A; } }