If you sketch the path of the boat, you will form a right triangle towards the port. The distance from the port to the present position is the hypotenuse since it is opposite from the right angle formed by the 12 miles north and 5 miles east movement. Since it is a right triangle, use the Pythagorean Theorem to solve the hypotenuse.