#include using namespace std; int main(){ long long a,b,c;cin>>a>>b>>c; cout << (c/(a+b-1))*a+max(a,c%(a+b-1)) << endl; }