#include <bits/stdc++.h>
using namespace std;
char num[1005][1005];
int col[1005];
int nuoi[1005];
int tonum[1005];
int main(int argc, char const *argv[]) {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      cin >> num[i][j];
      if (num[i][j] == '*') col[i]++, nuoi[j]++;
    }
  long long ans = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      if (num[i][j] == '*') ans += 1LL * (col[i] - 1) * (nuoi[j] - 1);
    }
  printf("%I64d\n", ans);
}
