#include using namespace std; using ll = long long; #define fi first #define se second int main(){ int n; cin >> n; cout << (n % 3 == 0 ? 0 : 3 - n % 3) << endl; return 0; }