import os #数据已改 (-170,-1000),(0,700),(40,940), (300, 2500),(550,7500) def calnum (x1, y1, x2, y2, t): return int( ((y2-y1)/(x2-x1)) * (t - x1) + y1 ) t =100 x1 , x2 = 0, 0 y1 , y2 = 0, 0 while (True): t = int( input()) if t < -400: print("-400") if t > 1000: print("1000") if t < -170: x1 = -170 y1 = -1000 x2 = 0 y2 = 700 print(calnum(x1, y1, x2, y2, t)) elif t < 0: x1 = -170 y1 = -1000 x2 = 0 y2 = 700 print(calnum(x1, y1, x2, y2, t)) elif t < 40: x1 = 0 y1 = 700 x2 = 40 y2 = 940 print(calnum(x1, y1, x2, y2, t)) elif t < 300: x1 = 40 y1 = 940 x2 = 300 y2 = 2500 print(calnum(x1, y1, x2, y2, t)) elif t < 550: x1 = 300 y1 = 2500 x2 = 550 y2 = 7500 print(calnum(x1, y1, x2, y2, t)) else: x1 = 300 y1 = 2500 x2 = 550 y2 = 7500 print(calnum(x1, y1, x2, y2, t))