#define DEB
#include <map>
#include <set>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>

#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;


#ifdef DEB
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
#define dumpR(x) cerr<<"\x1b[31m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
#define dumpY(x) cerr<<"\x1b[33m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
#define dumpG(x) cerr<<"\x1b[32m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define dumpR(x) ;
#define dumpY(x) ;
#define dumpG(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> bool chmin(T& a,const T& b) {
    if(a>b) {
        a=b;
        return true;
    }
    return false;
}
template<class T> bool chmax(T& a,const T& b) {
    if(a<b){
        a=b;
        return true;
    }
    return false;
}

typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
    template<class S,class T>
    ostream &operator <<(ostream& out,const pair<S,T>& a){
        out<<'('<<a.fr<<','<<a.sc<<')';
        return out;
    }
}

//const int INF=5e8;


char buf[105][105];
int h, w;
int main(){
    cin>>h>>w;
    REP(i,h) scanf("%s",buf[i]);
    int res=0;
    REP(i,h) REP(j,w-1) if(buf[i][j]=='.' && buf[i][j+1]=='.'){
        ++res;
    }
    REP(i,h-1) REP(j,w) if(buf[i][j]=='.' && buf[i+1][j]=='.'){
        ++res;
    }
    cout<<res<<endl;



}


#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
	int H,W,ans=0;
	string S[102];
	bool a[102][102]={0};
	cin>>H>>W;
	for(int i=0;i<H;i++){
		cin>>S[i];
		for(int j=0;j<W;j++){
			if(S[i][j]=='.')a[i+1][j+1]=true;
		}
	}
	for(int i=1;i<=H;i++){
		for(int j=1;j<=W;j++){
			ans+=a[i][j]&&a[i][j+1];
			ans+=a[i][j]&&a[i+1][j];
		}
	}
	cout<<ans;
	return 0;
}