#include using namespace std; typedef long long ll; int main(void) { ll a,b,t; cin >> a >> b >> t; ll ret = 1LL<<60; for(ll y=0;y*b <= t+b && y<=a;y++){ ret = min(ret,y*b + (t -y*b + a-1)/a*a); } cout << ret << endl; return 0; }