#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int a, b, c, d, i, j, n, m, k;
char mas[1001][1001];
int cr[1001], cc[1001];
long long ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int _n((n)-1), i(0); i <= _n; i++) scanf("%s", mas[i]);
  for (int _n((n)-1), i(0); i <= _n; i++) {
    for (int _n((m)-1), j(0); j <= _n; j++) {
      if (mas[i][j] == '*') {
        ++cr[i];
        ++cc[j];
      }
    }
  }
  for (int _n((n)-1), i(0); i <= _n; i++) {
    for (int _n((m)-1), j(0); j <= _n; j++) {
      if (mas[i][j] == '*') {
        ans += (long long)(cr[i] - 1) * (cc[j] - 1);
      }
    }
  }
  cout << ans << endl;
}
