#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int gx,gy; cin >> gx >> gy; if(gx == 0 || gy == 0) cout << 1 << endl; else if(gx == gy || gx == -gy) cout << 1 << endl; else cout << 2 << endl; }