Answer
$ 3.46\times10^8 m$.
Work Step by Step
Let the distance from Earth to the spacecraft be x, and from the spacecraft to the moon be L-x, where L is the Earth-moon distance.
The magnitude of the force of gravity exerted on the spacecraft by the Earth is:
$$\frac{Gm_{earth}m_{spacecraft}}{x^2}$$
The magnitude of the force of gravity exerted on the spacecraft by the moon is:
$$\frac{Gm_{moon}m_{spacecraft}}{(L-x)^2}$$
Set the two expressions equal and solve.
$$x=L\frac{\sqrt{ m_{earth}}}{ \sqrt{ m_{earth}}+ \sqrt{ m_{moon}}}=3.46\times10^8 m$$