ln=list(map(int,input().split())) A=ln[0] B=ln[1] C=ln[2] D=A+B-1 x=C//D total=0 age=0 rest=C total+=x*D age+=x*A rest=C-total if A>=C: age=C else: age+=rest print(age)