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