from math import ceil x,y = map(int,input().split()) d = 2 * (x**2 + y**2)** 0.5 print(int(d)+1 if int(d) == d else int(ceil(d)))