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