a, b, c, d, e, f = map(int, input().split()) c, d, f = c/2/a, d/2/a, (f-e)/a print((f + c**2 + d**2) ** 0.5)