// yukicoder: No.98 円を描こう
// 2019.4.9 bal4u
// 三平方の定理

#include <stdio.h>
#include <math.h>

int main()
{
	long long x, y, a, ans;

	scanf("%lld%lld", &x, &y);
	a = 4*(x * x + y * y);
	ans = (long long)sqrt((double)a);
	if (ans * ans <= a) ans++;
	printf("%lld\n", ans);
	return 0;
}