A,B,C=map(int,input().split()) D=A+B-1 Q,R=divmod(C,D) print(A*Q+min(A,R))