#pragma GCC optimize ("Ofast")
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i=(a); i<(b); i++)
#define FORD(i, a, b) for (int i=(a); i>(b); i--)
#define PPC(x) __builtin_popcount(x)
#define MSB(x) (31 - __builtin_clz(x))
#define SZ(x) ((int)(x).size())
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
#define ithBit(m, i) ((m) >> (i) & 1)
#define ft first
#define sd second
#define kw(a) ((a) * (a))
#ifdef DEBUG
#include "debug.h"
#else
#define dbg(...) 0
#endif
using namespace std;

const int maxN = 1 << 8;

char T[maxN][maxN];

void solve()
{	
	int n, m;
	scanf ("%d%d", &n, &m);
	FOR(i, 0, n)
		scanf ("%s", &T[i][0]);
	int res = 0;
	
	FOR(i, 0, n) FOR(j, 0, m)
	{
		if (T[i][j] == '.' and T[i][j+1] == '.')
			res++;
		if (T[i][j] == '.' and T[i+1][j] == '.')
			res++;
	}
	printf("%d\n", res);
}
 
int main()
{
	int t = 1;
	//scanf ("%d", &t);
	FOR(tid, 1, t+1)
	{
		//printf("Case #%d: ", tid);
		solve();
	}
	return 0;
}



#include <bits/stdc++.h>
using namespace std;

typedef long long LL;

#define FOR(i,a,b) for(int _n(b),i(a);i<_n;i++) 
#define REP(i,n) FOR(i,0,n)

void setIO() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
}

const int MX = 3;
int a[MX];
int n;

int main() {
    setIO();
    REP(i, 3) cin >> a[i];
    sort(a, a+3);
    int r = 0;
    if (a[0] == a[1]) r = a[2];
    else if (a[1] == a[2]) r = a[0];
    cout << r << endl;
    return 0;
}
