While studying Markov processes, I faced to the following task. Please help to solve.
We have the Markov Chain with two states. This Markov chain is shown here: 
The probabilities of transitions $p$ and $q$ are known. The initial state is $1$ with probability = $1$. A walk along this chain is started and it is interrupted as soon as state $2$ has been visited $n$ times. Let the random variable $\xi$ be the number of visits to state $1$ before the interruption. How can we find the variance of $\xi$?
Upd. The first thought I had was to represent $\xi$ as a random variable with Negative binomial distribution. But this is incorrect because different sequences of states 1, 2 have different probability of realizations.
The next attempt was like this. Let $F_m(k)$ be the probability of visiting the state 1 $k$ times with interrupt condition is the second state is visited $m$ times. Then variance of $\xi$ is $V(x) = E \xi^2 - E^2 \xi$, when $$ E \xi = \sum_{k=1}^{\infty} k F_n(k), E \xi^2 = \sum_{k=1}^{\infty} k^2 F_n(k) . $$
$F_n(k)$ can be expressed using recursion. Recursion base is $$ F_1(k) = (1-p)^{k-1} p . $$ For $F_n(k), n > 1$ we get $$ F_n (k) = \sum_{j=1}^{k-1} F_{n-1} (k-j) (1-p)^{j-1} p + F_{n-1}(k)(1-q). $$ I tried to switch from recursion to an closet formula, but power terms appear together with Bernoulli numbers and it becomes completely unclear how to count $E \xi, E \xi^2$.