A, B, T = map(int, input().split()) i = 0 ans = 10**18 while True: if i>=A or B*i>T: break j = (T-i*B+A-1)//A ans = min(ans, A*j+B*i) i += 1 print(ans)