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