Logan's school is due west of his house and due south of his friend Pete's house. The distance between the school and Pete's house is 3 miles and the straight-line distance between Logan's house and Pete's house is 5 miles. How far is Logan's house from school?