#include using namespace std; using ll = long long; int main() { ll x, y; cin >> x >> y; ll ans = 0; if (x == 0 && y == 0)ans = 0; else if (x == 0)ans = 1LL; else if (y == 0)ans = 1LL; else if (x == y)ans = 1LL; else if (x == -y)ans = 1LL; else ans = 2LL; cout << ans << endl; }