a,b,c = map(int,input().split()) if a==b: print(a) exit() r = (c-b)//(b-a) x = b-r*a print(c*r+x)