year = int(input().strip()) ans = 2017 - year print(ans)