#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e11 + 5;
const int MAX = 1e5 + 10;
char c[1020][1020];
long long n1[1010], n2[1010];
int main() {
  int n, m;
  long long ans = 0;
  scanf("%d%d", &n, &m);
  memset(n1, 0, sizeof(n1));
  memset(n2, 0, sizeof(n2));
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) {
      scanf(" %c", &c[i][j]);
      if (c[i][j] == '*') {
        n1[i]++, n2[j]++;
      }
    }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (c[i][j] == '*') ans += (n1[i] - 1) * (n2[j] - 1);
  printf("%I64d\n", ans);
  return 0;
}
