import strutils, sequtils, algorithm, future {.warning[SmallLshouldNotBeUsed]: off.} when isMainModule: var b = stdin.readLine.split.map(parseFloat) r = (b[2] - b[1]) / (b[1] - b[0]) d = b[1] - r*b[0] echo((r*b[2] + d).int)