Looksery Cup 2015
A
Face Detection
Codeforces
900
原题
←B →
翻译中…

The developers of Looksery have to write an efficient algorithm that detects faces on a picture. Unfortunately, they are currently busy preparing a contest for you, so you will have to do it for them.

翻译中…

In this problem an image is a rectangular table that consists of lowercase Latin letters. A face on the image is a $2 × 2$ square, such that from the four letters of this square you can make word "face".

翻译中…

You need to write a program that determines the number of faces on the image. The squares that correspond to the faces can overlap.

翻译中…

Input

翻译中…

The first line contains two space-separated integers, $*n*$ and $*m*$ ($1 ≤ *n*, *m* ≤ 50$) — the height and the width of the image, respectively.

翻译中…

Next $*n*$ lines define the image. Each line contains $*m*$ lowercase Latin letters.

翻译中…

Output

翻译中…

In the single line print the number of faces on the image.

翻译中…

Note

翻译中…

In the first sample the image contains a single face, located in a square with the upper left corner at the second line and the second column:

翻译中…

image

翻译中…

In the second sample the image also contains exactly one face, its upper left corner is at the second row and the first column.

翻译中…

In the third sample two faces are shown:

翻译中…

image

翻译中…

In the fourth sample the image has no faces on it.

翻译中…

样例

Input #1
4 4
xxxx
xfax
xcex
xxxx
Output #1
1
InputCopy OutputCopy
Input #2
4 2
xx
cf
ae
xx
Output #2
1
InputCopy OutputCopy
Input #3
2 3
fac
cef
Output #3
2
InputCopy OutputCopy
Input #4
1 4
face
Output #4
0
InputCopy OutputCopy
题目信息
题号
549A
所属比赛
时间限制
1 s
内存限制
256 MB
标签
模拟
字符串

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。