Let’s first tackle the arrangment problem. Fix 8 men into the line. There are 9 slots where you can place a woman. Therefore the number of arrangments is \({9 \choose 5}\).

For each such arrangment, there are \(5!\) and \(8!\) ways to arrange the women and the men among themselves, respectively. Therefore the total number of arrangements is \({9 \choose 5} \cdot 5! \cdot 8!\).