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

int main(){
  int h,w;
  cin >> h >> w;
  vector<string> s(110);
  rep(i,h) cin >> s[i];
  int cnt=0;
  rep(i,h)rep(j,w){
    if(s[i][j]=='.'&&s[i][j+1]=='.') cnt++;
    if(s[i][j]=='.'&&s[i+1][j]=='.') cnt++;
  }
  cout << cnt << endl;
}
//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#include <bits/stdc++.h>
#include<set>
using namespace std;
#define ll long long
#define endl '\n'
#define pb push_back
#define ff first
#define ss second




#define si(x) int(x.size())
#define sum_all(a)     ( accumulate ((a).begin(), (a).end(), 0ll))
#define mine(a)    (*min_element((a).begin(), (a).end()))
#define maxe(a)    (*max_element((a).begin(), (a).end()))
#define mini(a)    ( min_element((a).begin(), (a).end()) - (a).begin())
#define maxi(a)    ( max_element((a).begin(), (a).end()) - (a).begin())
vector<ll> s;

void pre()
{
	s=vector<ll>(1e6+13,0);

	for(ll i=1;i<si(s);i++)
	{
		s[i]=i;
	}
	for(ll i=2;i<si(s);i++)
	{
		if(s[i]==i)
      for(ll j=i;j<si(s);j+=i)
      	 if(s[j]==j) s[j]=i;
	}
	return ;
}

ll calc(ll a,ll n)
{
  
  if(n<=1) return 0; 
  if(a==1) return 0;
  ll temp=a;
  
  set<ll> primes;
  // cout << s[4] << endl;
  while(temp>1)
  {
    primes.insert(s[temp]);
    temp/=s[temp];

  }
  vector<ll> prime;
  for(auto a:primes) prime.pb(a);
  // cout << si(prime) << endl;
// cout << prime[0] << " "<< prime[1] << endl;
  ll N= si(prime);
// cout << prime[0] << endl
ll ans=0; 
for(ll i=1;i<(1<<N);i++)
{
ll cnt=0 ;
ll rs=0;
ll k=1;
for(ll j=0;j<N;j++)
{
	if( (1<< j )  & i)
	{
		cnt++;
		k*=prime[j];
	}
}

 rs=n/k;
 if(cnt%2==0) rs*=-1;
 ans+=rs;

}
return ans; 
}
ll calc2(ll a,ll n)
{
    if(a<=1) return 0;
	return n/a;
}


void solve()
{
 
   pre();
   ll l,r;
   cin >> l >> r ;

      // cout << calc(6,2) << endl; 
   ll A=0;
   for(ll i=l;i<=r;i++)
   {
  // cout <<  (calc(i,r)-calc(i,l-1)) << endl;
     A+= (calc(i,r)-calc(i,l-1));
   }
   // cout << A << endl;
   ll  B=0;
   for(ll i=l;i<=r;i++)
   {
   	 if(i==1) continue;
   	B+=(calc2(i,r)-calc2(i,l-1))*2-1;
   	// cout << (calc2(i,r)-calc2(i,l-1))*2-1 << endl;
   }
   cout << A-B << endl; 


}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif



    //int t; cin >> t; while (t--)
    solve();

}
