# include <cstdio>
# include <cctype>
template <class code>inline code read (const code &a)
{
	code x=0;short w=0;char ch=0;
	while (!isdigit (ch)) {w|=ch=='-';ch=getchar ();}
	while (isdigit (ch)) {x=(x<<3)+(x<<1)+(ch^48);ch=getchar ();}
	return w?-x:x;
}
int main ()
{
	int a=read (a),b=read (b),c=read (c);
	printf ("%d\n",a-b+c);
	return 0;
}
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(c) (c).begin(), (c).end()
#define pb push_back
#define eb emplace_back
using namespace std;
const long long INF = 1LL<<60; // 仮想的な無限大の値;
using ll = long long;
using P  = pair<int, int>;
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main()
{
    int h, w;
    cin >> h >> w;
    vs s(h);
    rep(i, h) cin >> s[i];
    int ans = 0;
    rep(i, h)rep(j, w){
        if(s[i][j] == '#') continue;
        if(i+1 < h && s[i+1][j] == '.') ++ans;
        if(j+1 < w && s[i][j+1] == '.') ++ans;
    }
    cout << ans << endl;
    return 0;
}