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