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