b1, b2, b3 = map(int, input().split()) ans = (b3 - b2) * (b3 - b2) // (b2 - b1) + b3 print(ans)