import math x, y = map(int, raw_input().split()) d = math.sqrt(x*x + y*y) if d*d == x*x + y*y: print int(2*d+1) else: print int(math.ceil(2*d))