#include #include using namespace std; using i32 = int; using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; #define FAST_IO \ ios::sync_with_stdio(false); \ cin.tie(0); const i64 INF = 1001001001001001001; using Modint = atcoder::static_modint<998244353>; int main() { FAST_IO auto ans = 0LL; i64 Gx, Gy; cin >> Gx >> Gy; if (Gx == 0 && Gy == 0) { cout << 0 << endl; return 0; } if (abs(Gx) == abs(Gy)) { ans = 1; } else if (Gx == 0 || Gy == 0) { ans = 1; } else { ans = 2; } cout << ans << endl; }