#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k = 0, s = 0;
  cin >> n >> m;
  vector<vector<char> > v(n, vector<char>(m));
  vector<int> str(n);
  vector<int> sto(m);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> v[i][j];
      if (v[i][j] == '*') k++;
    }
    str[i] = k;
    k = 0;
  }
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) {
      if (v[i][j] == '*') k++;
    }
    sto[j] = k;
    k = 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (v[i][j] == '*') s += (str[i] - 1) * (sto[j] - 1);
    }
  }
  cout << s;
  return 0;
}
