#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589793238462643383;
const long long INF = 1e9 + 7;
const long long mod = 998244353;
int getID(char c) {
  if (c == ' ') return 0;
  return c - 'a' + 1;
}
long long pw(long long a, long long b) {
  long long res = 1ll;
  while (b) {
    if (b & 1ll) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
void solve() {
  int n, m;
  cin >> n >> m;
  int a[m], b[n];
  char v[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> v[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    b[i] = 0;
    for (int j = 0; j < m; j++) {
      if (v[i][j] == '*') b[i]++;
    }
  }
  for (int i = 0; i < m; i++) {
    a[i] = 0;
    for (int j = 0; j < n; j++) {
      if (v[j][i] == '*') a[i]++;
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (v[i][j] == '*') {
        ans += 1ll * (b[i] - 1) * 1ll * (a[j] - 1);
      }
    }
  }
  cout << ans;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
