#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for(ll i = m; i < (n); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>; 
using vl = vector<ll>;
using vll = vector<vl>;
using pll = pair<ll, ll>;

int main() {
    ll H, W;
    cin >> H >> W;
    vector<string> S(H);
    rep(i, H){
        cin >> S[i];
    }

    ll ans = 0;
    rep(i, H){
        rep(j, W-1){
            if(S[i][j] == '.' && S[i][j+1] == '.'){
                ans++;
            }
        }
    }

    rep(i, W){
        rep(j, H-1){
            if(S[j][i] == '.' && S[j+1][i] == '.'){
                ans++;
            }
        }
    }

    cout << ans;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endll "\n"
#pragma GCC optimize(1)
#pragma GCC optimize(2)
#define ull unsigned long long
#define rep(i,b) for(int i=0;i<b;i++)
#define For(i, a, b) for(int i=a;i<=b;i++)
#define Rof(i, a, b) for(int i=a;i>=b;i--)
#define rest(a, b) memset(a,b, sizeof(a));
#define recopy(a, b) memcpy(b, a, sizeof(a));
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
int gcd(int a, int b) {while (b ^= a ^= b ^= a %= b);return a;}//最大公约数
ll gcd(ll a, ll b) {while (b ^= a ^= b ^= a %= b);return a;}
const int inf = 0x3f3f3f3f;
const int mod = 1e9+7;
const int N=1e5+50;
const int maxx=1e7;
int vis1[N],vis2[N];
int a[N],b[N],c[N];
int main(){
    int n,m;
    cin>>n>>m;
    rest(vis1,0)
    rest(vis2,0)
    int k=0;
    rep(i,n){
        cin>>a[i];
        vis1[a[i]]=1;
    }
    rep(i,m){
        cin>>b[i];
        vis2[b[i]]=1;
    }
    rep(i,n)
    {
        if(vis2[a[i]]==0)
        {
            c[k++]=a[i];
        }
    }
    rep(i,m){
        if(vis1[b[i]]==0){
            c[k++]=b[i];
        }
    }
    sort(c,c+k);
    rep(i,k){
        cout<<c[i]<<" ";
    }
    return 0;
}
