#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-5;
int x[1000], y[1000];
int n, m;
long long ans = 0;
char c;
int Qx[1000 * 1000], Qy[1000 * 1000];
int Qs;
char in[1000];
int main() {
  cin >> n >> m;
  for (int i = 0; i < (int)n; ++i) {
    scanf("%s", in);
    for (int j = 0; j < (int)m; ++j) {
      if (in[j] == '*') {
        y[j]++;
        x[i]++;
        Qx[Qs] = j;
        Qy[Qs] = i;
        ++Qs;
      }
    }
  }
  for (int i = 0; i < (int)Qs; ++i) ans += (y[Qx[i]] - 1) * (x[Qy[i]] - 1);
  cout << ans << endl;
}
