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