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