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