in order, for an affine to work properly (so that you can uniquely decrypt from a ciphertext back to its corresponding plaintext), $a^{-1}$ must exist. For some $n$, some integers in $\{0, 1, …, n − 1\}$ do not have an inverse. For example, clearly $0$ is not invertible and, if $n= 26$, then all even numbers are not invertible. Euler's totient function, $\phi(n)$ enumerates the number of values in $\{0, 1, …, n − 1\}$ that are invertible. Look up how to compute Euler's totient function online and determine the number of integers in $\{0, 1, …, 25\}$ that are invertible.
I still have no idea how to deal with this question. Could anyone give me some idea?