#include <bits/stdc++.h>
using namespace std;
char ch[1001][1001];
int row[1001], col[1001], n, m;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> ch[i][j];
      if (ch[i][j] == '*') row[i]++, col[j]++;
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (ch[i][j] == '*') ans += (row[i] - 1) * (col[j] - 1);
    }
  }
  cout << ans << endl;
}
