import math x, y = map(int,input().split()) ans = math.ceil(2 * math.sqrt(x*x + y*y)) if 2 * math.sqrt(x*x + y*y) == ans: ans += 1 print(ans)