#include<bits/stdc++.h>
using namespace std;






int main(){
  int n;
  cin>>n;
  if(n==0){cout<<1<<endl;}
  if(n==1){cout<<2<<endl;}
  if(n==2){cout<<1<<endl;}
  if(n>2){cout<<0<<endl;}

  return 0;  
}

