#P1234. 小 A 的口头禅

小 A 的口头禅

Description

{{Xiao A recently picked up a catchphrase "hehe", so he gives a rectangle and asks you to count how many "hehe\verb!hehe!" there are inside (as straight lines in the upward, downward, leftward, or rightward directions).}}

Input Format

{{The first line contains two numbers n,mn, m, representing the size of the rectangle.

Then follow nn lines, each with mm characters, representing the rectangle.}}

Output Format

{{Output a single number on one line, representing how many "hehe\verb!hehe!" there are.}}

5 5
heheh
heheh
heheh
heheh
heheh

10

Hint

{{1n,m10001 \leq n, m \leq 1000.}}

Translated by ChatGPT 5