Where did Francis Scott Key when he wrote the star spangled banner?

on a ship