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