#include #include using namespace std; using namespace atcoder; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll inf=14449999; ll mod=998244353; int main(){ ll n; cin >> n; if (n%3==1) { cout << 2 << endl; }else if (n%3==2) { cout << 1 << endl; }else{ cout <<0 << endl; } }