//活动地址: 牛客春招刷题训练营 - 编程打卡活动
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
typedef long long ll;
#define int long long
inline ll read() // void int &n
{
ll s=0,f=1;
char c=getchar();
while(c>'9'||c<'0')
{
if(c=='-')
f=-1;
c=getchar();
}
while(c>='0'&&c<='9')
{
s=(s<<1)+(s<<3)+c-'0';
c=getchar();
}
return s*f;
}
inline void write(int n)
{
if(n<0)
{
putchar('-');
n=-n;
}
if(n>10) write(n/10);
putchar(n%10+'0');
}
int jiechen(int n)
{
int sum = 1;
for (int i = 2; i <= n; i++)
sum = sum * i % mod;
return sum % mod;
}
int qsm(ll a, ll p)
{
ll s=1;
while(p)
{
if(p&1)
s=s*a%mod;
a=a*a%mod;
}
return s;
}
ll isprime(ll x)
{
if(x<2)
return 0;
for(int i=2;i<=x/i;i++)
if(x%i==0)
return 0;
return 1;
}
bool cmp(int x, int y){
return x>y;
}
const int N=3e6+10;
const int M =100000;
void solve(){
// 这题主要看你能不能一下就想到那几种特殊情况 分四种情况 此外 误解
int x,y;
cin>>x>>y;
if(x==y)cout<<0;
else if(x==0)cout<<2;
else if(y==0)cout<<1;
else if(x+y==0)cout<<3;
else cout<<-1;
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int _=1;
//cin>>_;
while(_--)
{
solve();
}
return 0;
}