x, y = map(int, input().split()) len_d = ((x**2 + y**2)**(0.5)) * 2 if len_d == int(len_d): print(int(len_d)+1) else: rint(int(len_d))