#include <bits/stdc++.h>
using namespace std;
int NR, NC;
char grid[1100][1100];
int R[1100];
int C[1100];
long long ans = 0;
int main() {
  cin >> NR >> NC;
  for (int i = 0; i < NR; i++) R[i] = 0;
  for (int i = 0; i < NC; i++) C[i] = 0;
  for (int i = 0; i < NR; i++)
    for (int j = 0; j < NC; j++) {
      cin >> grid[i][j];
      if (grid[i][j] == '*') {
        R[i]++;
        C[j]++;
      }
    }
  for (int i = 0; i < NR; i++)
    for (int j = 0; j < NC; j++) {
      if (grid[i][j] == '*') ans += (R[i] - 1) * (C[j] - 1);
    }
  printf("%I64d\n", ans);
}
