1181_C. Flag
Innokenty works at a flea market and sells some random stuff rare items. Recently he found an old rectangular blanket. It turned out that the blanket is split in n ⋅ m colored pieces that form a rectangle with n rows and m columns. 

The colored pieces attracted Innokenty's attention so he immediately came up with the following business plan. If he cuts out a subrectangle consisting of three colored stripes, he can sell it as a flag of some country. Innokenty decided that a subrectangle is similar enough to a flag of some country if it consists of three stripes of equal heights placed one above another, where each stripe consists of cells of equal color. Of course, the color of the top stripe must be different from the color of the middle stripe; and the color of the middle stripe must be different from the color of the bottom stripe.

Innokenty has not yet decided what part he will cut out, but he is sure that the flag's boundaries should go along grid lines. Also, Innokenty won't rotate the blanket. Please help Innokenty and count the number of different subrectangles Innokenty can cut out and sell as a flag. Two subrectangles located in different places but forming the same flag are still considered different.

<image> <image> <image>

These subrectangles are flags.

<image> <image> <image> <image> <image> <image>

These subrectangles are not flags.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 1 000) — the number of rows and the number of columns on the blanket.

Each of the next n lines contains m lowercase English letters from 'a' to 'z' and describes a row of the blanket. Equal letters correspond to equal colors, different letters correspond to different colors.

Output

In the only line print the number of subrectangles which form valid flags.

Examples

Input


4 3
aaa
bbb
ccb
ddd


Output


6


Input


6 1
a
a
b
b
c
c


Output


1

Note

<image> <image>

The selected subrectangles are flags in the first example.
```python
import os
from io import BytesIO, StringIO
#input = BytesIO(os.read(0, os.fstat(0).st_size)).readline

DEBUG = True
debug_print = print if DEBUG else lambda *x,**y: None

def input_as_list():
    return list(map(int, input().split()))

def array_of(f, *dim):
    return [array_of(f, *dim[1:]) for _ in range(dim[0])] if dim else f()

def main():
    n, m = input_as_list()
    g = [input() for _ in range(n)]

    prev_flgs = dict()
    s = 0
    for j in range(m):
        lst = []
        prev = ''
        cnt = 0
        for i in range(n):
            e = g[i][j]
            if e == prev:
                cnt += 1
            else:
                if prev: lst.append((prev, cnt))
                prev = e
                cnt = 1
        lst.append((e, cnt))

        flgs = dict()
        idx = 0
        for i in range(len(lst) - 2):
            f1, f2, f3 = lst[i], lst[i+1], lst[i+2]
            if f1[1] == f2[1] == f3[1]:
                flgs[idx] = [f1[0]+f2[0]+f3[0], f1[1], 1]
            elif min(f1[1], f2[1], f3[1]) == f2[1]:
                flgs[idx+f1[1]-f2[1]] = [f1[0]+f2[0]+f3[0], f2[1], 1]
            idx += f1[1]

        if prev_flgs:
            for f in flgs:
                if f in prev_flgs:
                    fv = flgs[f]
                    pfv = prev_flgs[f]
                    if fv[0] == pfv[0] and fv[1] == pfv[1]:
                        s += pfv[2] + 1
                        flgs[f][2] = pfv[2] + 1
                    else:
                        s += 1
                else:
                    s += 1
        else:
            s += len(flgs)
        prev_flgs = flgs

    print(s)

main()
```