P1234 {{Xiao A's Catchphrase}}
Background
{{}}
Description
{{Xiao A recently picked up a catchphrase "hehe", so he gives a rectangle and asks you to count how many "$\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, m$, representing the size of the rectangle.
Then follow $n$ lines, each with $m$ characters, representing the rectangle.}}
Output Format
{{Output a single number on one line, representing how many "$\verb!hehe!$" there are.}}
Explanation/Hint
{{$1 \leq n, m \leq 1000$.}}
Translated by ChatGPT 5