#include<iostream>
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    if (N == 0) cout << 1 << endl;
    else if (N == 1) cout << 2 << endl;
    else if (N == 2) cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}
