#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;

int h, w;

bool contain(int y, int x){
    return (0 <= y && y < h && 0 <= x && x < w);
}

signed main(){
    int m, n;
    cin >> m >> n;
    char c[110][110];
    int d[110][110] = {0};
    rep(i, 0, m){
        rep(j, 0, n){
            cin >> c[i][j];
        }
    }
    h = m;
    w = n;
    int ans = 0;
    rep(i, 0, m){
        rep(j, 0, n){
            if(c[i][j] == 'o'){
                rep(k, 0, 3){
                    int y = i;
                    int x = j + k - 1;
                    if(contain(y, x)){
                        d[y][x]++;
                    }
                }
            }
            if(c[i][j] == 'x'){
                rep(k, 0, 3){
                    rep(l, 0, 3){
                        int y = i + k - 1;
                        int x = j + l - 1;
                        if(contain(y, x)){
                            d[y][x]++;
                        }
                    }
                }
            }
        }
    }
    rep(i, 1, m){
        rep(j, 0, n){
            if(d[i][j] == 0) ans++;
        }
    }
    cout << ans << endl;
}