Solution (source code)

= Solution

There are $\lfloor n/2\rfloor$ even letters. The stated condition and injectivity force the even letters to permute among themselves, which can be done in $\lfloor n/2\rfloor!$ ways. The remaining odd letters must then permute among themselves. Thus the number is
$$
\boxed{\lfloor n/2\rfloor!\,\lceil n/2\rceil!}.
$$