Suppose that $X_1,X_2,\ldots$ are independent and exponentially distributed random variables with the parameter $\lambda$. Let us denote $S_n=X_1+\ldots+X_n$. I am interested in the distribution of the random variable $N=\min\{n\ge1:S_n\ge c\}$ with $c>0$, i.e. $N$ is a random variable that gives the smallest $n$ such that $S_n\ge c$.
I am trying to calculate the probabilities $P(N=k)$, where $k\ge1$. For $k=1$, $$ P(N=1)=P(S_1\ge c)=P(X_1\ge c)=e^{-\lambda c}. $$ For a general $k\ge1$ with a convention that $S_0=0$, $$ P(N=k)=P(\{S_k\ge c\}\cap\{S_{k-1}<c\})=P(c-X_k\le S_{k-1}<c), $$ but I have no idea how to evaluate this probability. How can I evaluate this probability?
I know that $S_n\sim\mathrm{Gamma}(n,\lambda^{-1})$, but I am not sure if that is useful.
Any help is much appreciated!
\begin{align} P(S_{k−1}+X_k≥c\mid S_k−1<c)&=P(c−X_k≤S_{k−1}<c)\\ &=\mathbb{E}_{X_k}[P(c−X_k≤S_{k−1}<c)]\\ &=\mathbb{E}_{X_k}\left[\frac{1}{\Gamma(k-1)} \gamma\left(k-1,\, \frac{c}{\theta}\right) - \frac{1}{\Gamma(k-1)} \gamma\left(k-1,\, \frac{c−X_k}{\theta}\right)\right]\\ &=\frac{1}{\Gamma(k-1)} \gamma\left(k-1,\, c \lambda\right) - \mathbb{E}_{X_k}\left[\frac{1}{\Gamma(k-1)} \gamma\left(k-1,\, \lambda(c−X_k)\right)\right]\\ &=\frac{1}{\Gamma(k-1)} \gamma\left(k-1,\, \frac{c}{\theta}\right) - \frac{1}{\Gamma(k-1)} \int_0^\infty \gamma\left(k-1,\, \lambda c− \lambda t\right) \lambda e^{-\lambda t} dt \end{align}