#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  vector<vector<char>> a(n, vector<char>(m));
  vector<pair<int, int>> poss;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
      if (a[i][j] == '*') {
        poss.push_back({i, j});
      }
    }
  }
  vector<long long> r(n);
  vector<long long> c(m);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      r[i] += (a[i][j] == '*');
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      c[i] += (a[j][i] == '*');
    }
  }
  long long ans = 0;
  while (!poss.empty()) {
    pair<int, int> cur = poss.back();
    poss.pop_back();
    ans += ((c[cur.second] - 1) * (r[cur.first] - 1));
  }
  cout << ans;
  return 0;
}
