#include using namespace std; using i64 = long long; #define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++) int x,y; int main(){ cin >> x >> y; if(y == x){ cout << 0 << endl; } else if(y == 0){ cout << 1 << endl; } else if(x == 0){ cout << 2 << endl; } else if(x == -y){ cout << 3 << endl; } else cout << -1 << endl; }