#include #include #include #include #include using ll = long long; using namespace std; const int MOD = 1e9+7; int main() { ll A, B, C, D; cin >> A >> B >> C; D = A+B-1; cout << C / D * A + C % D << endl; return 0; }