#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, n, m, a, b, step, k, ans, flag;
  scanf("%d", &x);
  scanf("%d", &y);
  ans = flag = n = m = step = k = 0;
  a = b = 1;
  while (!(x == n && y == m)) {
    if (k % 2 == 0) {
      if (a > 0)
        n++;
      else
        n--;
      step++;
      if (step == 1 && flag) ans++;
      if (abs(a) == step) {
        flag = 1;
        k++;
        step = 0;
        if (a > 0)
          a = -(a + 1);
        else
          a = -a + 1;
      }
    } else {
      if (b > 0)
        m++;
      else
        m--;
      step++;
      if (step == 1 && flag) ans++;
      if (abs(b) == step) {
        k++;
        step = 0;
        if (b > 0)
          b = -(b + 1);
        else
          b = -b + 1;
      }
    }
  }
  printf("%d", ans);
  return 0;
}
