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