#include <bits/stdc++.h>
using namespace std;
long long n, m, ans, c, d;
int a[1005][1005], b[1005][1005];
string s[1003];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < n; i++) {
    d = 0;
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '*') d++;
    }
    (d > 0) ? d-- : d;
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '*') a[i][j] = d;
    }
  }
  for (int i = 0; i < m; i++) {
    d = 0;
    for (int j = 0; j < n; j++) {
      if (s[j][i] == '*') d++;
    }
    (d > 0) ? d-- : d;
    for (int j = 0; j < n; j++) {
      if (s[j][i] == '*') b[j][i] = d;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '*') {
        ans += a[i][j] * b[i][j];
      }
    }
  }
  cout << ans;
}
