import math X,Y=map(int,input().split()) Z=X**2+Y**2 print(math.ceil(((Z)**0.5)*2+0.00001))