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