#include <cstdlib>
#include <iostream>
using namespace std;

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	cout << (n == 0 || n == 2 ? 1 : (n == 1 ? 2 : 0)) << endl;

	return EXIT_SUCCESS;
}