A,B,T=map(int,input().split()) a=A*B*T for i in range(min(A,T//B)+1): a=min(a,B*i+((T-B*i+A-1)//A)*A) print(a)