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