#include using namespace std; int main() { int x, y; cin >> x >> y; if (abs(x) == 0 && abs(y) == 0) cout << 0 << endl; else if (x == y) cout << 1 << endl; else if (x == 0 || y == 0) cout << 1 << endl; else cout << 2 << endl; }