Let $\{X_n\}$ be a markov chain, with transition probability matrix: $$\displaystyle P=\left( \begin{array}{ccccccc} 1/2 & 1/2 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1/2 & 1/2 & 0 & 0 & 0 & 0 \\ 1/4 & 0 & 0 & 1/2 & 1/4 & 0 & 0 \\ 0 & 0 & 0& 1/2 & 1/2 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1/2 & 1/4 & 1/4 \\ 0 & 0 & 0 & 0 & 1/4 & 1/2 & 1/4 \\ 0 & 0 & 0 & 0 & 1/2 & 1/2 & 0 \\ \end{array} \right).$$ If $X_0=1$, find $$\mathbb{E}\bigg[\sum_{k=1}^{T}\mathbb{I}_{\{X_k=3\}}\bigg],$$ where $T=\inf\{k\geq 0: ~X_k\in \{5,6,7\}\}.$
($\mathbb{I}_A$ denotes the index function on set $A$)
Attempt. There are three communication classes, the open $\{1,2,3\},~\{4\}$ and the closed $\{5,6,7\}$ (whose invariant distribution is $\pi =(2/5,2/5,1/5)$). I thought of a one step analysis, but i don't think it would get me anywhere.
Thank you in advance!