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