#include int main(){ int x, y; std::cin >> x >> y; puts((std::abs(x) == std::abs(y) || x * y == 0) ? "1" : "2"); }