#include using namespace std; int main(void) { int Gx,Gy; cin >> Gx >> Gy; if(Gx==0 && Gy==0){ cout << 0 << endl; return 0; } if(Gx==Gy || Gx*-1==Gy){ cout << 1 << endl; return 0; }else{ cout << 2 << endl; return 0; } }