#include <bits/stdc++.h>

using namespace std;

using ll = long long;

#define FOR(i,n,m) for(ll i=(n);i<(m);++i)
#define REP(i,n) FOR(i,0,n)

int main() {
	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;
	}
}
