  In a Cohen-Macaulay local ring $(A, \mathfrak{m})$, we study the Hilbert
function of an integrally closed $\mathfrak{m}$-primary ideal $I$ whose
reduction number is three. With a mild assumption we give an inequality
$\ell_A(A/I) \ge \mathrm{e}_0(I) - \mathrm{e}_1(I) + \dfrac{\mathrm{e}_2(I) +
\ell_A(I^2/QI)}{2}$, where $\mathrm{e}_i(I)$ denotes the $i$th Hilbert
coefficients and $Q$ denotes a minimal reduction of $I$. The inequality is
located between inequalities of Itoh and Elias-Valla. Furthermore our
inequality becomes an equality if and only if the depth of the associated
graded ring of $I$ is larger than or equal to $\dim A-1$. We also study the
Cohen-Macaulayness of the associated graded rings of determinantal rings.
