#include <bits/stdc++.h>
using namespace std;
char a[1010][1010];
long long b[1010], c[1010];
int main() {
  long long n, m, t = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
      if (a[i][j] == '*') b[i]++, c[j]++;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] == '*') t += (b[i] - 1) * (c[j] - 1);
    }
  }
  cout << t;
}
