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

int main(){
  int x,y;
  cin>>x>>y;
  int ans=abs(abs(x)-abs(y));
  
  if( abs(x) < abs(y) && x<0 )ans++;
  if( abs(x) <= abs(y) && y<0 )ans++;
  
  if( abs(x) > abs(y) && x>0 )ans++;
  if( abs(x) >= abs(y) && y>0 )ans++;
  
  cout<<ans<<endl;
  return 0;
}
