Beautyful squares
One day Peter came home first-grader, has made the lessons and started to think about what he would do. Nothing of interest had not occurred, so Peter took the checkered square sheet of paper the size of N rows by M columns and recorded in every cell of the capital letter of the alphabet. English Pete started to learn recently, and so long as he knows only the first 5 letters of the alphabet. Thus, each cell sheet was written the letter 'A' .. 'E'.
Looking at the results of his work, Peter was not satisfied - whether the list was too large, whether the letters were written on it in a bad manner. "Perhaps the situation can be improved if the cut from the original sheet smaller rectangle," - thought Petya. "And, of course, cut the rectangle should be beautiful!" But what a nice box? The fact that Pete did not like how the rectangles in the cells of which there are many different letters (4 or 5), and rectangles, the cells are little different letters (1 or 2). Therefore, he believes nice rectangle, if the number of different letters in its cells is 3.
Help Pete count how many ways he can cut from the original sheet of paper a nice rectangle. Incisions can be made only on the boundaries of cells. If the source rectangle is a beautiful leaf, it is possible that Peter wants nothing to cut out and keep the original box entirely, and it is also considered one of the ways to cut.
Note that each method of cutting can uniquely specify the Quartet non-negative integers (a, b, c, d), where a - number of lines, cut off from the original sheet on top, b - number of lines, cut off the bottom, c - number of columns, cut to the left and d - the number of columns, cut off on the right. Two ways to cut, asked quadruples (a, b, c, d) and (a', b', c', d'), considered different if at least one of the inequalities a ≠ a', b ≠ b', c ≠ c' or d ≠ d'.
Input
The first line specifies the number of rows N (1 ≤ N ≤ 400) written by Petya. Next N lines is given in the array of rows with the contents of the original sheet of paper. In the line t[i] are listed from left to right characters written in the cells (i +1)-th row from the top of the sheet. Number of characters per line is less than M (1 ≤ M ≤ 400).
Output
Integer equal to the number of ways to cut a beautiful box of the original sheet of paper.