Inspiration: in the free product $H=C_2*C_2=\langle a,b|a^2,b^2\rangle$ the element $ab$ has infinite order. And furthermore the only nontrivial coset of $\langle ab\rangle$ is $b\langle ab\rangle$ (every word in $H$ is either a product of $ab$s or it is $b$ followed by a product of $ab$s), so $\langle ab\rangle$ has index two.
The given information in this problem tells us $A=C\sqcup aC$ and $B=C\sqcup bC$ with the additional tidbits that $aC=Ca$ and $bC=Cb$. We may conclude $G=A*_CB$ is generated $a,b,C$ in $G$.
Consider the element $ab$ in $G$. It has infinite order, so it generates a cyclic group - what is the resulting index? Split into two indices, $G:\langle ab,C\rangle:\langle ab\rangle$. Note that $A,B$ finite $\Rightarrow C$ finite.
To compute $[\langle a,b,C\rangle:\langle ab,C\rangle]$, "mod out $C$" and take $[\langle a,b\rangle:\langle ab\rangle]=2$ (back in our $H=C_2*C_2$) as inspiration, and to compute $[\langle ab,C\rangle:\langle ab\rangle]$, "mod out $ab$."