#include using namespace std; int x,y; int main(){ cin>>x>>y; int t=-1; if(x==-y) t=3; if(!x) t=2; if(!y) t=1; if(x==y) t=0; cout<