import sys import math def input(): return sys.stdin.readline().rstrip() def main(): xp, yp = map(int, input().split()) R = math.sqrt(xp**2+yp**2) print(math.floor(2*R)+1) if __name__ == '__main__': main()