#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1010;
int N, M;
int C[MAXN];
int R[MAXN];
long long int res;
char ar[MAXN][MAXN];
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) {
      scanf(" %c", &ar[i][j]);
      if (ar[i][j] == '*') {
        R[i]++;
        C[j]++;
      }
    }
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++)
      if (ar[i][j] == '*') res += (R[i] - 1) * (C[j] - 1);
  printf("%lld\n", res);
  return 0;
}
