The formula we need to use is displacement.
[tex]d=\Delta{x}=x_f-x_i[/tex], where xf is final position and xi is initial position.
We report the final position of 5 and the displacement of 2 so the formula is now:
[tex]2=5-x_i\Longrightarrow x_i=3[/tex].
So the initial position of truck A is 3.
Hope this helps.
r3t40