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.
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.
n, m = map(int, input().split())

picture = []
for i in range(n):
		picture.append([letter for letter in input()])

def check_face(letter, coordinate, matrix):
	needed = [ "f", "a", "c", "e" ]
	needed.pop(needed.index(letter))
	for i in range(coordinate[0], coordinate[0]+2):
		for j in range(coordinate[1], coordinate[1]+2):
			if i == coordinate[0] and j == coordinate[1]:
				continue
			if matrix[i][j] in needed:
				needed.pop(needed.index(matrix[i][j]))
			else:
				return False
	if needed == []:
		return True
	else:
		return False

face_count = 0
for i in range(n-1):
	for j in range(m-1):
		cursor = picture[i][j]
		if  cursor == "f" or cursor == "a" or cursor == "c" or cursor == "e":
			is_face = check_face(cursor, [i,j], picture)
			if is_face:
				face_count += 1

print(face_count)