#!/usr/bin/python from math import hypot, ceil xp, yp = map(int, raw_input().split()) dist = hypot(xp, yp) a = int(ceil(dist + 1e-6)) x, y = 2*a, 2*a-1 print y if y > dist * 2 else x