#include <bits/stdc++.h>
using namespace std;
long long n, m, ans, a[1005];
char c[1005][1005];
vector<long long> v[1005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> c[i][j];
      if (c[i][j] == '*') {
        v[j].push_back(i);
        a[i]++;
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j < v[i].size(); j++) {
      ans += (v[i].size() - 1) * (a[v[i][j]] - 1);
    }
  }
  cout << ans << '\n';
  return 0;
}
