// MARK: - コード #include using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1000000007; // const ll MOD = 998244353; // using mint = modint998244353; const int dx[8] = {0, -1, 1, 0, -1, 1, -1, 1}; const int dy[8] = {-1, 0, 0, 1, -1, -1, 1, 1}; template istream &operator>>(istream &is, vector &v) { for (auto &e : v) is >> e; return is; } template ostream &operator<<(ostream &os, const vector &v) { for (auto &e : v) os << e << ' '; return os; } #define reps(i, l, r) for (std::decay_t i##_right = (r), i = (l); i < i##_right; i++) #define rep(i, n) reps(i, 0, n) template inline bool chmax(T &a,T& b){if(a < b){a = b; return true;} else return false;} template inline bool chmin(T &a,T& b){if(a > b){a = b; return true;} else return false;} int solve(int x, int y) { if (x == 0 && y == 0) return 0; if (x == 0 || y == 0) return 1; if (abs(x)==abs(y)) return 1; return 2; } int main() { int x, y; cin >> x >> y; cout << solve(x, y) << endl; } /* MARK: - メモ */