#include <bits/stdc++.h>
char map[1024][1024];
int cnt[1024], tnc[1024], n, m;
int main() {
  int i, j, k;
  long long ans = 0;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; ++i) {
    scanf("%s", map[i]);
    for (j = 0; j < m; ++j)
      if (map[i][j] == '*') {
        ++cnt[j];
        ++tnc[i];
      }
  }
  for (i = 0; i < n; ++i)
    for (j = 0; j < m; ++j)
      if (map[i][j] == '*') ans += (cnt[j] - 1) * (tnc[i] - 1);
  printf("%I64d\n", ans);
  return 0;
}
