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