This is a numerical-answer question. The correct answer is shown below.
[Solution by Dr. Abubacker] Equal distances: $4+9n^2+4=4+4+16p^2\Rightarrow3n=\pm4p$. Perpendicular: $\vec A\cdot\vec B=4-6n+8p=0$. With $p=\frac{3n}4$ this gives $4=0$ (impossible), so $p=-\frac{3n}4$: $4-6n-6n=0$, $n=\frac13$ and $n^{-1}=3$. Answer: 3.