#include <bits/stdc++.h>
using namespace std;
long long kiran_bhanushali[29][7][20];
void init() {
  for (long long i = 0; i < 29; i++) {
    kiran_bhanushali[i][0][0] = rand() % 1000;
  }
}
void solve() {
  long long n, m;
  cin >> n >> m;
  string s[n];
  for (long long i = 0; i < n; i++) cin >> s[i];
  long long r[n], c[m];
  for (long long i = 0; i < n; i++) r[i] = 0;
  for (long long i = 0; i < m; i++) c[i] = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (s[i][j] == '*') {
        r[i]++;
        c[j]++;
      }
    }
  }
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (s[i][j] == '*') {
        cnt += (r[i] - 1) * (c[j] - 1);
      }
    }
  }
  cout << cnt << endl;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  init();
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
