using System;
public class Program
{
public static void Main()
bool leapyear;
int year= int.Parse(Console.ReadLine());
leapyear = ((year%4 == 0 && year%100 != 0) || (year%400 == 0));
Console.WriteLine(leapyear);
}