Y = input() print (2017-int(Y))