#include <bits/stdc++.h>
using namespace std;
void process(int n, int m, vector<vector<bool>> a) {
  long long x = 0;
  vector<int> r(n);
  vector<int> c(m);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j]) {
        r[i]++;
        c[j]++;
      }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j]) x += (r[i] - 1) * (c[j] - 1);
  cout << x << endl;
}
int main() {
  int n, m;
  vector<vector<bool>> a;
  cin >> n >> m;
  a.resize(n);
  for (int i = 0; i < n; i++) {
    a[i].resize(m);
    for (int j = 0; j < m; j++) {
      char c;
      cin >> c;
      a[i][j] = c == '*';
    }
  }
  process(n, m, a);
  return 0;
}
