#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int n, m;
char a[N][N];
int row[N], col[N];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", &a[i]);
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    int rowStar = 0;
    for (int j = 0; j < m; j++) {
      if (a[i][j] == '*') rowStar++;
    }
    row[i] = rowStar;
  }
  for (int j = 0; j < m; j++) {
    int colStar = 0;
    for (int i = 0; i < n; i++) {
      if (a[i][j] == '*') colStar++;
    }
    col[j] = colStar;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i][j] == '*') {
        ans += 1ll * (col[j] - 1) * (1ll * (row[i] - 1));
      }
    }
  }
  printf("%lld\n", ans);
}
