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