import math x,y = map(int,raw_input().split()) R = math.ceil(2*(x**2+y**2)**0.5+0.00000001)/2.0 print int(2*R)