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