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