Let there be two bins $b_1$ and $b_2$. We denote the number of balls in $b_1$ as $X_1$ and $b_2$ as $X_2$. The probability a particular ball lands in $b_1$ is given by $p$, and $b_2$ given by $1-p$. We throw in distinguishable balls one by one in the same order until One of ($X_1$, $X_2$) = $C$

Show that $\arg\max_{p}{E[(X_1 + X_2) s.t. one of (X_1,X_2) = C]}$ is given by $p=0.5$

Right now, I have formulated the problem as below,

$$E[(X_1 + X_2) s.t. one of (X_1,X_2) = C] = $$ $$\sum_{i=0}^{C-1}\left(\begin{array}{c}{C+i-1}\\{i}\end{array}\right)\left((1-p)^{i}p^{C}\right)(C+i)+\sum_{i=0}^{C-1}\left(\begin{array}{c}{C+i-1}\\{i}\end{array}\right)\left(p^{i}(1-p)^{C}\right)(C+i)$$

When you take the derivative with respect to $p$ it is clear that $p = 0.5$ leads to a derivative of $0$, but I'm not sure how to show that it is the maximum. I'm having trouble showing that for $0\leqq p<0.5$ the gradient is positive, and for $\ 0.5<p\leqq1$ the gradient is negative, or that $p=0.5$ is a unique solution.

As an aside, the actual problem is with k bins but I'm having trouble even with the simplified two bins case.