Two of the altitudes of an acute triangle divide the sides into segments of lengths 5,3,1 and x units, as shown. What is the value of x?