In practical applications it is important to estimate the distribution of the number of events of interest arisen between two consequent exceedances of some process $\{R_n\}_{n\ge 1}$ over a threshold $u$\[T(u)=\min\{j\ge 1:R_{j+1}>u|R_{1}>u\}.\]In telecommunications, one can interpret it as a number of successfully delivered packets between two consequent ones whose rates of transmission $\{R_i\}$ exceed the channel capacity $u$. Then the sum $S(u)=\sum_{i=1}^{T(u)}X_i$, where $\{X_i\}$ are inter-arrival times between packets, determines the lossless time.We prove the following theorem.\begin{theorem}Let $\{R_n\}_{n\ge 1}$ be a stationary process with the extremal index$\theta$ and the asymptotic independence of maxima $AIM(x_{\rho_n})$ \cite{Brien} is satisfied. Let$x_{\rho_n}$ be a sequence of quantiles of $R_1$ of the level $1-\rho_n$, i.e. $\overline{F}(x_{\rho_n})=\PP\{R_1>x_{\rho_n}\}=\rho_n$, that satisfies the condition $\lim_{n\to\infty}n(1-F(x_{\rho_n}))=\tau,\qquad 0