#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const int dy[8] = {-1,-1, 0, 1, 1, 1, 0,-1}; 
const int dx[8] = { 0, 1, 1, 1, 0,-1,-1,-1};

char s[105][105];

int main()
{
	memset(s, 0, sizeof(s));
	rep (i, 105) rep (j, 105) s[i][j] = '-';
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int M, N; cin >> M >> N;
	rep (i, M) rep (j, N) cin >> s[i+1][j+1];

	int res = 0;
	for (int i = 2; i <= M; ++i){
		for (int j = 1; j <= N; ++j){
			bool ng = false;
			if (s[i][j] != '-') ng |= true;
			if (s[i][j-1] != '-' || s[i][j+1] != '-') ng |= true;
			rep (k, 8)
				if (s[i+dy[k]][j+dx[k]] == 'x') ng |= true;
			if (!ng) ++res;
		} // end for
	} // end for
	cout << res << endl;

	return 0;
}