Tokens of several colors have been placed on a hex grid.
Your task is count the number of regular hexagons whose all vertices are of the same color.
The first line contains two numbers , . is the number of grid points in the first row, and is the number of rows. Odd-numbered rows contain grid points and even-numbered rows contain grid points.
The following lines contain a description of a board. A dot denotes an empty grid points, and colors are denoted by lowercase characters (’a’-’z’). See the example.
Output the number of regular hexagons.
Input
10 9 . . . . . . . . . . . . . . . . . . . . . . b a . a . . . . b . . b . . a a . . . a . . . a . a c b . . b . . a a c c c b a . a . . . c c . . . . . . . . . . . . . . . . .
Output
3