Let R(n,x) be the number of modular inverses modulo n that are less than x. It is well-known (e.g. Heath-Brown) that R(p,p^{3/4+\epsilon})\gg p^{1/2+\epsilon} for primes p. An open problem is to improve the exponent 3/4. In the talk, I will introduce how to study the average version of the problem in terms of the dynamics of continued fractions. This is research in progress.