#include using namespace std; int main(){ int x, y; cin >> x >> y; cout << (abs(x) == abs(y) || x == 0 || y == 0 ? 1 : 2) << '\n'; }