#include <bits/stdc++.h>
using namespace std;
int a[1005], b[1005];
bool v[1005][1005];
char s[1005];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    for (int j = 0; s[j]; j++) {
      if (s[j] == '*') {
        a[i]++;
        b[j]++;
        v[i][j] = 1;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (!v[i][j]) continue;
      ans += (a[i] - 1) * (b[j] - 1);
    }
  }
  printf("%I64d\n", ans);
}
