#include using namespace std; int main(void){ long long A,B,C; cin >> A >> B >> C; long long remain,block,length; if(A < 10) { block = (A - 1) + B; remain = C % block; if(A > remain) { cout << (C / block) * A + remain; } else { cout << (C / block) * A + A; } } else { block = C / (A - 1 + B); length = block * A; remain = C - length - (B - 1) * block; if(A > remain) { cout << length + remain; } else { cout << length + A; } } }