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