A,B,T=map(int, input().split()) res=float("inf") for y in range(A+1): if ((T-B*y+A-1)//A)<0: break res=min(res,A*((T-B*y+A-1)//A)+B*y) print(res)