//Aideen's Code for P33 {aideen[at]gmail[dot]com}
#include <iostream>
using namespace std;

int x, y;

long long solve(int x, int y) {
  int r = max(abs(x), abs(y));
  int s = 2*r+1;
  long long c = (long long)(s) * (s) - 1;
  if (y == r)			// top of the square
    return c - (r - x);
  c -= s-1;
  if (x == -r)			// left side of the square
    return c - (r - y);
  c -= s-1;
  if (y == -r)			// bottom side 
    return c - (x - -r);
  c -= s-1;
  if (x == r)			// right side
    return c - (y - -r);	
  return -1;			// if it failed!
}

int main() {
  cin >> x >> y;
  cout << solve(x, y) << endl;
  return 0;
}

