If you make your sketch, and label the points 1: the point the ship is when it first see the flash, 2 where it sees the flash for the second time and L the position of the lighthouse, you get:

Angle L12 = 15 degrees

Angle 1L2 = 90 - 60 = 30 degrees

Hence, angle 12L = 180 - (60 + 15) = 105 degrees

Side 12 = 10 km

Use the sine rule.

Let D be the distance you're looking for, that is when the ship is at 1.

Get this one first.