CSES - All Letter Subgrid Count II
  • Time limit: 1.00 s
  • Memory limit: 512 MB

You are given a grid of letters. Your task is to calculate the number of rectangle subgrids that contain all the letters.

Input

The first line has two integers nn and kk: the size of the grid and the number of letters. The letters are the first kk uppercase letters.

After this, there are nn lines that describe the grid. Each line has nn letters.

Output

Print the number of subgrids.

Constraints

  • 1n5001 \le n \le 500
  • 1k261 \le k \le 26

Example

Input:

5 3
ABBBC
BBBBC
BCAAA
AAAAA
AAAAA

Output:

70