A right-angled triangle has a base of and a height of . A square is drawn inside this triangle such that one side of the square is on the hypotenuse of the triangle, and the other two vertices of the square lie on the other sides of the triangle. The length of the side of the square can be expressed as so that and are coprime. What is the value of ?