#include<bits/stdc++.h>
using namespace std;
long long c=1;
long x,y;
int main()
{
cin>>x>>y;
if(x==y)
{
cout<<0;
return 0;
}
if(x==-y||x==y-1)
{
cout<<1;
return 0;
}
if(x>y)
{
x*=-1;
c=2;
}
while(1)
{
if(x==-y||x==y-1)
{
cout<<c;
return 0;
}
c++;
x++;
}
}