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