Let \( S = \{ m \in \mathbb{Z} : A^{m^2} + A^m = 3I - A^{-6} \} \), where. Then \( n(S) \) is equal to ________.