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