#include <bits/stdc++.h>
using namespace std;
int n, m;
char temp;
int x[1010], y[1010];
bool a[1010][1010];
int main(void) {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> temp;
      if (temp == '*') {
        x[i]++;
        y[j]++;
        a[i][j] = true;
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] == true) ans += (x[i] - 1) * (y[j] - 1);
    }
  }
  cout << ans << endl;
  return 0;
}
