#include <bits/stdc++.h>
using namespace std;
int n, m, col[1005], row[1005];
char a[1005][1005];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) scanf("%s", a[i]);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j)
      if (a[i][j] == '*') ++row[i], ++col[j];
  }
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (a[i][j] == '.') continue;
      ans += (row[i] - 1) * (col[j] - 1);
    }
  }
  cout << ans << endl;
}
