/**
 *    author:  tourist
 *    created: 27.01.2020 05:38:34       
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int x, y;
  cin >> x >> y;
  int ans = (x < y ? y - x : x - y + 2);
  ans = min(ans, abs(-x - y) + 1);
  cout << ans << '\n';
  return 0;
}
