class Problem0530: def solve(this): print(2017 - int(input())) if __name__ == "__main__": problem = Problem0530() problem.solve()