#include using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair int main() { int a, b; cin >> a >> b; int ans = -1; if (b == 0) { ans = 1; } else if (a == -1) { ans = 2; } cout << ans << endl; }