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