#include using namespace std; int main() { int64_t A, B, C; cin >> A >> B >> C; int64_t step = B+(A-1); int64_t tmp = C/step; int64_t tmp2 = A*tmp; int64_t tmp3 = tmp*step; int64_t ans = min(tmp2+(C-tmp3), tmp2+A); cout << ans << endl; return 0; }