def main(): Y = int(input()) # m/d: 1/1 # ans: 2017/06/23 print(2017 - Y) if __name__ == '__main__': main()