#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
int r[N], c[N];
char a[N][N];
int main() {
  int n, m;
  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] == '*') {
        r[i]++;
        c[j]++;
      }
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j] == '*') ans += (r[i] - 1) * (c[j] - 1);
  cout << ans;
  return 0;
}
