#include <bits/stdc++.h>
using namespace std;
long long rr[1010], cc[1010];
long long M[1010][1010];
int main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      char ck;
      cin >> ck;
      if (ck == '*') M[i][j] = 1, rr[i]++, cc[j]++;
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (M[i][j]) ans += (rr[i] - 1) * (cc[j] - 1);
    }
  }
  cout << ans << '\n';
  return 0;
}
