import math a, b = map(int, input().split()) print(int(math.hypot(a, b) * 2) + 1)