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

int main()
{
	//freopen("1.in","r",stdin);
	int x,y;
	cin>>x>>y;
	int ans=abs(x)-abs(y);
	if(ans<0)
	{
		ans=-ans;
		if(x<0){++ans;x=-x;}
		x=abs(y);
	}
	else
	if(ans>0)
	{
		if(x>0){++ans;x=-x;}
		x=-abs(y);
	}
	ans+=x!=y;
	cout<<ans;
}