One leg of a right triangle is 1 inch longer than the other leg. The hypotenuse has a length of 5 inches. Find the length of the two legs of the triangle