#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, c, co = 0, k = 0;
  cin >> r >> c;
  char arr[r + 1][c + 1];
  int row[10];
  int col[10];
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      cin >> arr[i][j];
      if (arr[i][j] != '.') {
        row[k] = i;
        col[k] = j;
      }
    }
  }
  int sum = 0;
  for (int i = 0, f = 0; i < r; i++, f = 0) {
    for (int j = 0; j < c; j++) {
      if (arr[i][j] != '.') f = 1;
    }
    if (!f) {
      sum += c;
      k++;
    }
  }
  for (int i = 0, f = 0; i < c; i++, f = 0) {
    for (int j = 0; j < r; j++) {
      if (arr[j][i] != '.') f = 1;
    }
    if (!f) {
      sum += r;
      co++;
    }
  }
  cout << sum - (k * co);
  return 0;
}
