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