#include <iostream>
#include <cmath>
#define int long long
using namespace std;

int x, y;

signed main() {
	cin >> x >> y;
	
	if (abs(x) > abs(y)) {
		cout << abs(x) - abs(y) + (x > 0) + (y > 0) << endl;
	}
	else if (abs(x) == abs(y)) {
		cout << 1 << endl;
	}
	else {
		cout << (x < 0) + abs(y) - abs(x) + (y < 0) << endl;
	}
	return 0;
}