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