#include <bits/stdc++.h>
char a[1001][1001];
long long res, n, m, h[1000], v[1000];
int main() {
  scanf("%d%d\n", &n, &m);
  for (int i = 0; i < n; ++i) gets(a[i]);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (a[i][j] == '*') {
        h[i]++;
        v[j]++;
      }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) {
      if (a[i][j] == '*') res += (h[i] - 1) * (v[j] - 1);
    }
  printf("%lld", res);
  return 0;
}
