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