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 while C>total: if A>=C: age=C break elif rest=A: age+=A break print(age)