#include <bits/stdc++.h>
using namespace std;
char a[1001][1001];
long long int row[1001], col[1001];
int main() {
  ios::sync_with_stdio(false);
  ;
  cin.tie(0);
  ;
  long long int i, j, n, m, ans = 0;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> a[i][j];
      if (a[i][j] == '*') {
        row[i]++;
        col[j]++;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (a[i][j] == '*') ans += (row[i] - 1) * (col[j] - 1);
    }
  }
  cout << ans;
  return 0;
}
