#include <bits/stdc++.h>
using namespace std;


int main()
{
	int x,y;
	cin>>x>>y;
	if(y>=0 && x >=0)
	{cout<<y-x;
	}
	else if(y<0 && x>0)
	{
		if((-1)*y==x)
		{cout<<"1";
		}
		else 
		{cout<<(-1*y)-x+1;
		}
	}
	else if( x < 0 && y < 0)
	{cout<<(-1*y)-(-1*x)+2;
	}
	
}