#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, i, j;
  char a[1001][1001];
  long long int hor[1001];
  long long int ver[1001];
  long long int count = 0;
  long long int val;
  scanf("%d%d", &m, &n);
  getchar();
  for (i = 0; i < m; i++) {
    count = 0;
    for (j = 0; j < n; j++) {
      scanf("%c", &a[i][j]);
      if (a[i][j] == '*') count++;
    }
    hor[i] = count;
    getchar();
  }
  for (j = 0; j < n; j++) {
    count = 0;
    for (i = 0; i < m; i++) {
      if (a[i][j] == '*') count++;
    }
    ver[j] = count;
  }
  val = 0;
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      if (a[i][j] == '*') val += (hor[i] - 1) * (ver[j] - 1);
    }
  }
  cout << val << endl;
  return 0;
}
