| The 2024 CCPC Online Contest |
|---|
| Закончено |
Siri is participating in the online preliminary round of the China Collegiate Programming Contest.
After finishing the sign-in problem, she went to the restroom. When she came back, she found that a character matrix had inexplicably appeared in the editor.
This character matrix has $$$n$$$ rows, each of length $$$m$$$, and consists only of lowercase letters.
She plans to choose two consecutive rows and two consecutive columns. The intersection of these two rows and two columns will form a $$$2\times 2$$$ submatrix.
She wants to know how many submatrices $$$A$$$ satisfying the above conditions satisfy $$$A = \begin{bmatrix} \text{c} & \text{c}\\ \text{p} & \text{c} \end{bmatrix}$$$.
The first line contains two positive integers $$$n,m$$$ ($$$2\le n, m \le 500$$$), indicating the size of the matrix.
The next $$$n$$$ lines each contain a string of length $$$m$$$, representing the character matrix. The data is guaranteed to contain only lowercase letters.
Output a single integer on one line, representing the answer.
3 4ccccspccccpc
2
| Название |
|---|


