#include #include using namespace std; int main(){ long A, B, C; cin >> A >> B >> C; cout << C / (A + B - 1) * A + min(C % (A + B - 1), A) << endl; }