#include <iostream>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <math.h>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
#define LL long long
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 10;
int n;
int main()
{
cin >> n;
if( n % 4 == 0 || n % 400 == 0 )
{
cout << "1";
}
else
{
cout << "0";
}
return 0;
}