#include #include #include #include using namespace std; int main(void){ long long a,b,c; cin >> a >> b >> c; long long x; x = (c/(a+b-1))*a + c%(a+b-1); cout << x << "\n"; return 0; }