#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j;
  scanf("%d %d", &n, &m);
  char c[n][m];
  long long int x[n], y[m];
  for (i = 0; i < n; ++i) {
    x[i] = 0;
    scanf("%s", c[i]);
  }
  for (i = 0; i < m; ++i) y[i] = 0;
  for (i = 0; i < n; ++i) {
    for (j = 0; j < m; ++j) {
      if (c[i][j] == '*') {
        x[i]++;
        y[j]++;
      }
    }
  }
  long long int count = 0;
  for (i = 0; i < n; ++i) {
    for (j = 0; j < m; ++j) {
      if (c[i][j] == '*') {
        count += (x[i] - 1) * (y[j] - 1);
      }
    }
  }
  printf("%I64d", count);
}
