#include #include #include using namespace std; static inline constexpr uint32_t solve(const int32_t G_x, const int32_t G_y) noexcept { if (G_x == 0) { if (G_y == 0) return 0; else return 1; } else if (G_y == 0) return 1; else if (abs(G_x) == abs(G_y)) return 1; else return 2; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int32_t G_x, G_y; cin >> G_x >> G_y; cout << solve(G_x, G_y) << '\n'; return 0; }