#include <iostream>
#include <string>
#include <vector>

using namespace std;


/*
无穷多次操作,第n灯的状态
*/
int main()
{
    long long n;
    while (cin >> n)
    {
        int count = 0;
        for (int i = 1; i <= n; i++)
        {
            if (n%i == 0)
            {
                count++;
            }
        }
        if (count % 2 == 0)
        {
            cout << 0 << endl;
        }
        else
        {
            cout << 1 << endl;
        }
    }
}