#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define repp(i,n) for(int i=1; i<=n; i++)
using namespace std;

int main(){
  int m,n;
  cin >> m >> n;
  char c[m+2][n+2];
  int flag[m+2][n+2];
  rep(i,m+2) rep(j,n+2) flag[i][j] = 0;
  repp(i,m){
    repp(j,n){
      cin >> c[i][j];
      if(c[i][j]=='o'){
	flag[i][j]=1;
	flag[i][j+1]=1;
	flag[i][j-1]=1;
      }
      if(c[i][j]=='x'){
	for(int x=i-1; x<i+2; x++){
	  for(int y=j-1; y<j+2; y++){
	    flag[x][y] = 1;
	  }
	}
      }
    }
  }
  repp(i,n) flag[1][i] = 1;
  /*rep(i,m+2){
    rep(j,n+2){
      cout << flag[i][j] << " ";
    }
    cout << endl;
  }*/
  int count=0;
  repp(i,m){
    repp(j,n){
      if(flag[i][j]==0) count++;
    }
  }
  cout << count << endl;
  
  return 0;
}

