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