let's say both had an original amount of "a".
then Liam deposited 140, so it became a + 140.
then Charlie added 5% of "a" to "a", well, 5% of anything is just (5/100)*anything, so 5% of "a" is just (5/100) *a or 0.05a.
then they checked their amounts and both were equal, what the? let's check.
[tex]\bf \stackrel{\textit{Liam}}{a+140}=\stackrel{\textit{Charlie}}{a+0.05a}\implies a+140=1.05a\implies 140=1.05a-a
\\\\\\
140=0.05a\implies \cfrac{140}{0.05}=a\implies \boxed{2800=a}[/tex]