print 2017-int(raw_input())