#include <bits/stdc++.h>
using namespace std;
char s[1005][1005];
long long C[1005], R[1005];
int main() {
  int n, m;
  long long ans = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) scanf("%s", &s[i]);
  for (int i = 0; i < n; i++) {
    int c = 0;
    for (int j = 0; j < m; j++) c += (s[i][j] == '*' ? 1 : 0);
    R[i] = c;
  }
  for (int j = 0; j < m; j++) {
    int c = 0;
    for (int i = 0; i < n; i++) c += (s[i][j] == '*' ? 1 : 0);
    C[j] = c;
  }
  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 << endl;
  return 0;
}
