#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k = 0, s = 0, c = 0, arr[10000], var[10000], l, n, m, dot = 0,
            es = 0, row = 0, col = 0, stv = 0, dot1 = 0;
  char x[1000][100];
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      cin >> x[i][j];
      if (x[i][j] == '.') {
        dot++;
      }
    }
    if (dot == m) {
      row++;
    }
    dot = 0;
  }
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      if (x[j][i] == '.') {
        dot1++;
      }
    }
    if (dot1 == n) {
      col++;
    }
    dot1 = 0;
  }
  cout << ((row * m) + (n - row) * col) << endl;
}
