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