#include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) int main() { long long A, B, T; cin >> A >> B >> T; long long min = 1e10; rep(j, A) { long long i = (T-B*j+A-1)/A; min = std::min(min, A*i+B*j); if(i > A) { break; } } std::cout << min << "\n"; return 0; }