#include <cstdio>
#include <algorithm>
int X, Y;
inline int dis(int x, int y)
{
	return x <= y ? y - x : 2100000000;
}
int main()
{
	scanf("%d%d", &X, &Y);
	printf("%d\n", std::min(std::min(dis(X, Y), dis(-X, -Y) + 2), std::min(dis(X, -Y), dis(-X, Y)) + 1));
	return 0;
}
