#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 20;
int n, m;
long long r[maxn], c[maxn];
string s[maxn];
template <class T>
T read() {
  T f = 1, k = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    k = k * 10 + c - '0';
    c = getchar();
  }
  return f * k;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (s[i][j] == '*') r[i]++, c[j]++;
  long long ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (s[i][j] == '*') ans += (r[i] - 1) * (c[j] - 1);
  cout << ans;
  return 0;
}
