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