#include  <iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int mx[] = {1,1,0,-1,-1,-1,0,1};
int my[] = {0,1,1,1,-0,-1,-1,-1};
int main(){


  char array[110][110];
  bool check[110][110];
  //int i,j,k ;
  int tate,yoko;
  int answer =0;

  cin >> tate >> yoko;
  rep(i,tate)rep(j,yoko)check[i][j]=true;
  rep(i,tate){
    rep(j,yoko){
      cin>> array[i][j];
      //cout<<"i="<<i<<" j="<<j<<endl;	
      if(array[i][j] =='o' || i == 0)
	{
	  check[i][j] = false;
	  int tempx = j+1;
	  int tempx2 = j-1;
	  if(tempx>=0 && tempx <yoko)
	    check[i][tempx] = false;
	  if(tempx2 >=0 && tempx2 < yoko)
	    check[i][tempx2]= false;
	}
      if(array[i][j] == 'x') {
	check[i][j]=false;
	rep(k,8){
	  int tempx = j+mx[k];
	  int tempy = i+my[k];
	  if(tempx>=0 && tempx <yoko && tempy >=0 && tempy < tate ){
	    check[tempy][tempx] =false;
	    //cout<<tempx<<" "<<tempy<<endl;
	 
	  }

	}

      }
      /* rep(i,tate){
	rep(j,yoko)cout<<check[i][j]<<" ";
	cout<<endl;
	}*/

    }
  }
    rep(i,tate)
      {
      rep(j,yoko)
	  {
	    // cout << check[i][j] << " " ;
	    if(check[i][j])
	      answer++;

	  }
      // cout<<endl;
      }
    cout << answer << endl;
  return 0;
}
  