#include <iostream>

using namespace std;

int solve(int n) {
    switch (n) {
        case 0:
            return 1;
        case 1:
            return 2;
        case 2:
            return 1;
        default:
            return 0;
    }
}
int main() {
    int n;
    cin >> n;
    cout << solve(n) << endl;
    return 0;
}