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