It is well-known that a connected regular graph is strongly-regular if and only if its adjacency matrix has exactly three eigenvalues. Let $B$ denote an integral square matrix and $langle B rangle$ denote the subring of the full matrix ring generated by $B$. Then $langle B rangle$ is a free $mathbb{Z}$-module of finite rank, which guarantees that there are only finitely many ideals of $langle B rangle$ with given finite index. Thus, the formal Dirichlet series $zeta_{langle B rangle}(s)=sum_{ngeq 1}a_n n^{-s}$ is well-defined where $a_n$ is the number of ideals of $langle B rangle$ with index $n$. In this article we aim to find an explicit form of $zeta_{langle B rangle}(s)$ when $B$ has exactly three eigenvalues all of which are integral, e.g., the adjacency matrix of a strongly-regular graph which is not a conference graph with a non-squared number of vertices. By isomorphism theorem for rings, $langle B rangle$ is isomorphic to $mathbb{Z}[x]/m(x)mathbb{Z}[x]$ where $m(x)$ is the minimal polynomial of $B$ over $mathbb{Q}$, and $mathbb{Z}[x]/m(x)mathbb{Z}[x]$ is isomorphic to $mathbb{Z}[x]/m(x+gamma)mathbb{Z}[x]$ for each $gammain mathbb{Z}$. Thus, the problem is reduced to counting the number of ideals of $mathbb{Z}[x]/x(x-alpha)(x-beta)mathbb{Z}[x]$ with given finite index where $0,alpha$ and $beta$ are distinct integers.