#include #define rep(i, n) for (int i = 0; i < n; ++i) typedef long long ll; using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int N; cin >> N; if (N % 3 == 0) cout << 0; if ((N - 2) % 3 == 0) cout << 1; if ((N - 4) % 3 == 0) cout << 2; cout << "\n"; return 0; }