#32541: 這次真的是答案了啦


yp11151138@yphs.tp.edu.tw (908-33許劭頎)


include<iostream>

using namespace std;

int main(){

int m,d;

cin>>m,d;

cout<<(m*2+d)%3<<endl;

return 0

}