A ship leaves a dock and sails 15 miles due east. The ship then sails due north and hits an ocean buoy. A rescue boat travels the shortest distance from the dock to the ship, 17 miles. How many miles north did the ship sail before it hit the ocean buoy? Use mathematics to explain how you determined your answer.