A,B,C=map(int,input().split())
cnt=A+B-1
f=C//cnt
res=C%cnt
if res>A:
    res=A
print(f*A+res)