#include using namespace std; int main(){ int N; scanf("%d", &N); printf("%d\n", N * 2 % 3); }