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