#include <bits/stdc++.h>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <queue>
#include <deque>
#include <vector>
#define loop(i,a,b) for (int i = (a); i <= (b); i++)
#define loopr(i, a, b) for(int i = (a); i >= (b); i--)
#define pb(a) push_back(a)
#define pf(a) push_front(a)
#define mp(a,b) make_pair(a,b)
#define fast_io ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define ll long long int
#define mod 1000000007
#define mod1 998244353
using namespace std;

int maxSubArraySum(int a[], int size) 
{ 
    int max_so_far = INT_MIN, max_ending_here = 0; 
  
    for (int i = 0; i < size; i++) 
    { 
        max_ending_here = max_ending_here + a[i]; 
        if (max_so_far < max_ending_here) 
            max_so_far = max_ending_here; 
  
        if (max_ending_here < 0) 
            max_ending_here = 0; 
    } 
    return max_so_far; 
} 

int main()
{	
	ll n,x;
	cin>>n>>x;
	vector<int> a(n),ans;
	loop(i,0,n-1)
	{
		cin>>a[i];
		if(a[i]!=x)
		{
			ans.push_back(a[i]);
		}
	}
	for(auto x : ans)
	{
		cout<<x<<" ";
	}
}


#include <bits/stdc++.h>
#include <random>
#include <time.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)

using namespace std;
using ll = long long;
using P = pair<int,int>;
using ull= unsigned long long;
const ll K_MAX=1e5+5;
const ll Lmax=ll(1e18);
const int Nmax=2e5+1;
const int Nd=61;
const int INF=1e5;



int main(){
  int h,w;
  cin>>h>>w;
  vector<string> s(h);
  ll ans=0;
  rep(i,h){
    cin>>s[i];
    //まずは横に並べる方法を考える
    rep(j,w-1){
      if(s[i][j]=='.' && s[i][j+1]=='.'){
        ans++;
      }
    }
  }

  //縦にしく場合
  rep(j,w){
    rep(i,h-1){
      if(s[i][j]=='.' && s[i+1][j]=='.'){
        ans++;
      }
    }

  }
  cout<<ans<<endl;

  return 0;

}
