#include<bits/stdc++.h>

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)

using namespace std;

int h,w;
string c[110];
bool f[110][110];

int main() {
  cin >> h >> w;
  rep(i,h) {
    cin >> c[i];
  }
  rep(i,w) f[0][i] = true;
  rep(i,h) {
    rep(j,w) {
      if( c[i][j] == 'o' ) {
	f[i][j] = true;
	if( j - 1 >= 0  ) f[i][j-1] = true;
	if( j + 1 <  w  ) f[i][j+1] = true;
      } else if( c[i][j] == 'x' ) {
	f[i][j] = true;
	REP(dy,-1,2) {
	  REP(dx,-1,2) {
	    int nx = j + dx, ny = i + dy;
	    if( ( 0 <= nx && nx < w && 0 <= ny && ny < h ) ) {
	      f[ny][nx] = true;
	    }
	  }
	}
      } 
    }
  }
  int cnt = 0;
  rep(i,h) rep(j,w) if( f[i][j] == false ) ++cnt;
  cout<< cnt << endl;
  
  return 0;
}