Random walk with accumulation of penalties

Let a random walf with a certain stopping time $$T$$. Say that step $$i$$ costs $$i$$. If we can compute the average value of $$T$$, what is the correct (non biaised) way to compute the average cost?

Le $$E(T)$$ be the mean stopping time. Is the average cost simply $$\frac{E(T)(E(T)+1)}{2}$$ ?

Thank you.