#include using namespace std; #define mp make_pair #define pb push_back #define all(x) (x).begin(),(x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") #define Yes() printf("Yes\n") #define No() printf("No\n") #define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w #define int long long //typedef long long ll; typedef vector vb; typedef vector vi; typedef vector vvb; typedef vector vvi; typedef pair P; template T &chmin(T &a, const T &b) { return a = min(a, b); } template T &chmax(T &a, const T &b) { return a = max(a, b); } const int INF=1e+18; const double EPS=1e-9; const int MOD=1000000007; const int dx[]={1,0,-1,0},dy[]={0,-1,0,1}; signed main(){ int a,b,ans = -1; cin >> a >> b; if(a == b) ans = 0; else if(!a) ans = 2; else if(!b) ans = 1; else if(a + b == 0) ans = 3; cout << ans << endl; return 0; }