#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, nowx = 0, nowy = 0, d = 0, len = 1, remain = 1, ans = -1;
  scanf("%d%d", &x, &y);
  while (nowx != x || nowy != y) {
    if (remain == len) ans++;
    switch (d) {
      case 0:
        nowx++;
        break;
      case 1:
        nowy++;
        break;
      case 2:
        nowx--;
        break;
      case 3:
        nowy--;
        break;
    }
    remain--;
    if (!remain) {
      d = (d + 1) % 4;
      if (d == 0 || d == 2) len++;
      remain = len;
    }
  }
  cout << max(0, ans) << endl;
  return 0;
}
