year = int(input()) leap_check = year % 400 ''' year%4==0 year%100!=0 or year%4==0 year%400==0 ''' if leap_check == 0 : print(1) elif leap_check % 100 != 0 and leap_check % 4 == 0 : print(1) else: print(0)