#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000 + 10;
int n;
int m;
int c[MAX];
int r[MAX];
int main() {
  cin >> n;
  cin >> m;
  char d[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> d[i][j];
      if (d[i][j] == '*') {
        r[i]++;
        c[j]++;
      }
    }
  }
  long long t = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (d[i][j] == '*') {
        t = t + ((r[i] - 1) * (c[j] - 1));
      }
    }
  }
  cout << t;
}
