a,b,c=map(int,input().split()) t=b+a-1 temp=c//t mod=c%t print(temp*a+mod)