Solution (source code)

= Solution

The $D$ free embedding scalars contribute $c_X=D$. The ordinary diffeomorphism ghosts contribute $c_{bc}=-26$. The fermionic $(m,n)$ pair has $h_n=0$ and contributes $-2$. Each of the $D/2$ fermionic $(\chi_a,\psi^a)$ pairs has $h_\psi=1/2$ and contributes $+1$. Each bosonic $(\beta_r,\gamma^r)$ pair has $h_\gamma=-1/2$ and contributes $+11$, and there are two such pairs. The total holomorphic <central charge> is therefore
$$
c_{\rm tot}=D-26-2+\frac D2+22=\frac{3D}{2}-6.
$$
Cancellation of the <worldsheet Weyl anomaly> requires $c_{\rm tot}=0$, so
$$
\boxed{D=4}.
$$
The antiholomorphic sector gives the same condition.