#include<iostream>
using namespace std;

int main(int argc, char *argv[]){
  int n;
  cin >> n;
  if(n == 0){
    std::cout << 1 << std::endl;
  }else if(n == 1){
    std::cout << 2 << std::endl;
  }else if(n == 2){
    std::cout << 1 << std::endl;
  }else{
    std::cout << 0 << std::endl;
  }
  return 0;
}