import sys def MI(): return map(int,sys.stdin.readline().rstrip().split()) A,B,T = MI() inf = 10**18 ans = inf for i in range(min(T//B,A)+1): ans = min(ans,A*((T-B*i+A-1)//A)+B*i) print(ans)