using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Baekjoon
{
class Program
{
static void Main(string[] args)
{
int x = int.Parse(Console.ReadLine());
if ((x%4==0) && (x%100!=0 | x%400==0))
{
Console.WriteLine(1);
}
else
{
Console.WriteLine(0);
}
}
}
}