#include #include using namespace std; #define rep(i,a) for(int i=0;i=b;i--) using ll = long long; using ld = long double; using vi= vector; using vvi= vector; using vs= vector; using pii= pair; using vpii= vector; #define endl '\n' int main(void){ cin.tie(nullptr); ios::sync_with_stdio(false); ll x, y; cin >> x >> y; if(x == 0 && y == 0)cout << 0 << endl; else if(abs(x) == abs(y)|| x == 0 || y == 0)cout << 1 << endl; else cout << 2 << endl; }