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