from math import sqrt a, b, c, d, e, f = map(int, input().split()) c, d, f = c/a, d/a, (f-e)/a print(sqrt(f + c*c/4 + d*d/4))