A,B,C = map(int,input().split()) ans = C//(A+B-1)*A+min(A,C%(A+B-1)) print(ans)