#include <bits/stdc++.h>
using namespace std;
int n, m, a[2005], b[2005];
char second[2005][2005];
int main() {
  scanf("%d%d\n", &n, &m);
  for (int i = 0; i < n; ++i) {
    gets(second[i]);
    for (int j = 0; j < m; ++j)
      if (second[i][j] == '*') a[i]++, b[j]++;
  }
  long long res = 0;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (second[i][j] == '*') res += (a[i] - 1) * (b[j] - 1);
  cout << res;
  return 0;
}
