#include using namespace std; int main() { int gx, gy; cin >> gx >> gy; if (gx == 0 and gy == 0){ cout << 0 << endl; } else if(abs(gx) == abs(gy)){ cout << 1 << endl; } else if (gx == 0 or gy == 0) { cout << 1 << endl; } else { cout << 2 << endl; } }