Let $a_1, a_2, . . ., a_n$ be a finite sequence of $0$ and $1$. Under any two consecutive terms of this sequence $0$ is written if the digits are equal and $1$ is written otherwise. This way a new sequence of length $n -1$ is obtained. By repeating this procedure $n - 1$ times one obtains a triangular table of $0$ and $1$. Find the maximum possible number of ones that can appear on this table