#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  long long x,y;cin>>x>>y;
  long long res=1ll<<60;
  if (y>=x)res = min(res,y-x);
  if (y>=-x)res = min(res,y+x+1);
  if(-y>=x)res = min(res,-y-x+1);
  if(-y>=-x)res =min(res,-y+x+2);
  cout<<res<<endl;
}
