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.
nm = input()
n = int(nm.split()[0])
m = int(nm.split()[1])
img = []
faces = 0
for i in range(n):
    x = input()
    img.append(x)
for s in range(len(img)):
    for i in range(len(img[s])):
        loc1 = True
        loc2 = True
        loc3 = True
        loc4 = True
        if i == 0:
            loc1 = False
            loc3 = False
        if s == n-1:
            loc1 = False
            loc2 = False
        if i == m-1:
            loc2 = False
            loc4 = False
        if s == 0:
            loc3 = False
            loc4 = False
        if img[s][i] == 'f' and loc1:
            if 'a' in (img[s][i-1], img[s+1][i], img[s+1][i-1]) and \
               'c' in (img[s][i-1], img[s+1][i], img[s+1][i-1]) and \
               'e' in (img[s][i-1], img[s+1][i], img[s+1][i-1]):
                faces += 1
        if img[s][i] == 'f' and loc2:
            if 'a' in (img[s][i+1], img[s+1][i], img[s+1][i+1]) and \
               'c' in (img[s][i+1], img[s+1][i], img[s+1][i+1]) and \
               'e' in (img[s][i+1], img[s+1][i], img[s+1][i+1]):
                faces += 1
        if img[s][i] == 'f' and loc3:
            if 'a' in (img[s][i-1], img[s-1][i], img[s-1][i-1]) and \
               'c' in (img[s][i-1], img[s-1][i], img[s-1][i-1]) and \
               'e' in (img[s][i-1], img[s-1][i], img[s-1][i-1]):
                faces += 1
        if img[s][i] == 'f' and loc4:
            if 'a' in (img[s][i+1], img[s-1][i], img[s-1][i+1]) and \
               'c' in (img[s][i+1], img[s-1][i], img[s-1][i+1]) and \
               'e' in (img[s][i+1], img[s-1][i], img[s-1][i+1]):
                faces += 1
print(faces)
    
