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