#coding: utf-8 ##yuki_176 import sys A,B,T=map(int,input().split()) res=sys.maxsize for x in range(A+1): if x*B>=T+B: break temp=x*B+A*int((T-x*B+A-1)/A) if temp<=res: res=temp print(res)