#include #define rep(i,n) for(int i=0;i ; using pll = pair; const ll INF = 1e18; const int MOD = 1000000007; int main(){ int a,b; cin >> a >> b; if(a==b) cout << 0 << endl; else if(a==0) cout << 2 << endl; else if(b==0) cout << 1 << endl; else cout << -1 << endl; return 0; }