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