#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define INF 1e18;

int main(){
  ll x,y;
  cin>>x>>y;
  ll ans;
  ans=(x>y?x-y+2:y-x);
  ans=min(ans,abs(y+x)+1);
  cout<<ans<<endl;
  return 0;
}
