#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
int get(int a, int b)
{
	if (a > b)return 2100000000;
	else return b - a;
}
int main()
{
	int a, b;
	scanf("%d%d", &a, &b);
	printf("%d\n", min(min(get(a, b), get(-a, b) + 1), min(get(a, -b) + 1, get(-a, -b) + 2)));
}