#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; int main(void){ ll a, b, c; cin >> a >> b >> c; ll ans = 0; ans += a*(c / (a + b - 1)); if ((a + b - 1)*(c / (a + b - 1)) + a - 1 < c){ ans += a; } else{ ans += c - (a + b - 1)*(c / (a + b - 1)); } cout << ans << endl; }