Let $\omega\neq 1$ be a cube root of unity and $S$ be the set of all non-singular matrices of the form $\begin{vmatrix}1&a&b\\\omega&1&c\\\omega^2&\omega&1\end{vmatrix}$ where each of a,b and c is either $\omega$ or $\omega^2$.Then the number of distinct matrices in the set S is