#include<iostream>
#include<algorithm>
using namespace std;
long long INF=123456789123456789;
int main()
{
  long long x,y,res=INF;
  cin >> x >> y;
  if(y>x) res=y-x;
  if(y>=-x) res=min(y+x+1,res);
  if(-y>=x) res=min(-y-x+1,res);
  if(-y>-x) res=min(-y+x+2,res);
  cout << res << endl;
  return 0;
}