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.
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int a, b;
    cin >> a >> b;

    vector< vector<char> > x;

    for (int i=0; i < a; i++) {
        vector<char> k;
        for (int j=0; j < b; j++) {
            char c;
            cin >> c;
            k.push_back(c);
        }

        x.push_back(k);
    }
    int ct = 0;
    for (int i=0; i < a-1; i++) {
        for (int j=0; j < b-1; j++) {
            vector<char> n;
            n.push_back(x[i][j]);
            n.push_back(x[i][j+1]);
            n.push_back(x[i+1][j]);
            n.push_back(x[i+1][j+1]);
            sort(n.begin(), n.end());
            vector<char> dead;
            dead.push_back('f');
            dead.push_back('a');
            dead.push_back('c');
            dead.push_back('e');
            sort(dead.begin(), dead.end());

            if (dead == n) {
                ct += 1;
            }
        }
    }

    cout << ct << endl;
    system("pause");
}

