#include <iostream>

using namespace std;

int main ()
{
    int h, w, sek, j, i;
    cout << "visina i sirina table:" << endl;
    cin >> h;
    cin >> w;

    sek=0;
    char matrica [h][w];

    cout << "popunjavanje matrice:" << endl;
    for (i=0; i<h ; i++)
    {
        for (j=0; j<w ; j++)
        {
            cin >> matrica[i][j];
        }
    }


        for (i=0; i<h ; i++)
    {
        for (j=0; j<w ; j++)
        {
            if (matrica [i+1][j] == '.')
            {
                sek = sek+1;
            }else if (matrica [i+1][j+1] == '.')
                {
                    sek = sek+1;
                }else if (matrica [i][j+1] == '.')
                    {
                        sek = sek+1;
                    }
                    else if (matrica [i+2][j+1] == '.')
                        {
                             sek = sek+1;
                        }else if (matrica [i+1][j+2] == '.')
                            {
                                sek = sek+1;
                            }

        }
    }

    cout << sek;
    return 0;
}