def main(): x, y = map(int, input().split()) radius = (x ** 2 + y ** 2) ** 0.5 print(2 * int(radius) + 1) if __name__ == "__main__": main()