Hello Codeforces, recently, there was a contest on CSAcademy named "FiiCode 2021 Round 2" and there was a task "Clown Fiesta", in a editorial for the task, there were lines such like:

If we take a sequence, where $$$a_0 = m$$$, $$$a_1 = \varphi (a_0)$$$, $$$a_2 = \varphi (a_1)$$$, $$$...$$$, $$$a_{k-1} = \varphi (a_{k-2}) \neq 1$$$, $$$a_k = \varphi (a_{k-1}) = 1$$$ and $$$m$$$ is prime number less than $$$10^9$$$, then $$$k$$$ will be not greater than $$$log_2(m)$$$.

Can someone prove it?

P.S. link to problem.