#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; if(N%3 == 1) { cout << 2 << "\n"; } else { cout << (N%3)/2 << "\n"; } }