The diagonals of a trapezoid are perpendicular and have lengths 8 and 10. Find the length of the median of the trapezoid.