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