#include <iostream>
using namespace std;

int main(){
  int s[110][110]={0},m,n,sum;
  char a;
  cin>>m>>n;
  for(int i=1;i<=m;i++){
    for(int j=1;j<=n;j++){
      cin>>a;
      if(a=='o')s[i][j]=1;
      if(a=='x')s[i][j]=2;
    }
  }
  for(int i=1;i<=m;i++){
    for(int j=1;j<=n;j++){
      if(i==1&&s[i][j]==0)s[i][j]=3;
      if(s[i][j]==1){
	if(s[i][j-1]==0)s[i][j-1]=3;
	if(s[i][j+1]==0)s[i][j+1]=3;
      }
      else if(s[i][j]==2){
	if(s[i-1][j-1]==0) s[i-1][j-1]=3;
	if(s[i-1][j]==0)   s[i-1][j]=3;
	if(s[i-1][j+1]==0) s[i-1][j+1]=3;
	if(s[i][j-1]==0)   s[i][j-1]=3;
	if(s[i][j+1]==0)   s[i][j+1]=3;
	if(s[i+1][j-1]==0) s[i+1][j-1]=3;
	if(s[i+1][j]==0)   s[i+1][j]=3;
	if(s[i+1][j+1]==0) s[i+1][j+1]=3;
      }
    }
  }
  sum=0;
  for(int i=1;i<=m;i++){
    for(int j=1;j<=n;j++){
      if(s[i][j]==0)sum++;
      //cout<<s[i][j];//////////
    }
    //cout<<endl;//////////////
  }
  cout<<sum<<endl;
  return 0;
}