Ikta loves fast programs. Recently, I'm trying to speed up the division program. However, it doesn't get much faster, so I thought it would be better to make it faster only for "common sense and typical" inputs. The problem Ikta is trying to solve is as follows.

For a given non-negative integer n, divide p (n) − 1-digit positive integer 11 ... 1 by p (n) in decimal notation. However, p (n) represents the smallest prime number larger than 22 {... 2} (n 2). Let p (0) = 2.

Your job is to complete the program faster than Ikta.



Input

The input is given in the following format.


n


Given the non-negative integer n of the input in question.

Constraints

Each variable being input satisfies the following constraints.

* 0 ≤ n <1000

Output

Print the solution to the problem on one line.

Examples

Input

0


Output

1


Input

1


Output

2


Input

2


Output

1
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
typedef long long ll;

int main() {

    int n;
    cin >> n;

    if(n == 0) {
        cout << 1%2 << endl;
    }

    if(n == 1) {
        cout << 11%3 << endl;
    }
    
    if(n == 2) {
        cout << 111%5 << endl;
    }

    if(n >= 3) {
        cout << 0 << endl;
    }
    
    return 0;
}