a,b,c=map(int,input().split());print(c//(a+b-1)*a+min(a,c%(a+b-1)))