import math a, b = map(int, input().split()) c = math.sqrt(a**2 + b**2) print(int(c * 2 + 1) if c == int(c) else math.ceil(c * 2))