#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
bool is_prime(int n) {
  if (n == 2) return true;
  if (n % 2 == 0 || n < 2) return false;
  for (int i = 3; i <= sqrt(n); i += 2) {
    if (n % i == 0) return false;
  }
  return true;
}
long long power(long long n, long long k) {
  if (k == 0) return 1;
  long long sq = (power(n, k / 2)) % mod;
  sq = (sq * sq) % mod;
  if (k % 2 == 1) sq = (sq * n) % mod;
  return sq % mod;
}
void low(char &c) { c = tolower(c); }
void primeFactors(int n) {
  while (n % 2 == 0) {
    cout << 2 << " ";
    n = n / 2;
  }
  for (int i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      cout << i << " ";
      n = n / i;
    }
  }
  if (n > 2) cout << n << " ";
}
using namespace std;
void fast();
int arr[1009];
int arr2[1009];
vector<string> vect;
int main() {
  int n, m;
  cin >> n >> m;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    vect.push_back(s);
    int res = 0;
    for (int j = 0; j < m; j++) {
      if (s[j] == '*') res++;
    }
    arr[i] = res;
  }
  for (int i = 0; i < m; i++) {
    int res = 0;
    for (int j = 0; j < n; j++) {
      if (vect[j][i] == '*') res++;
    }
    arr2[i] = res;
  }
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (vect[i][j] == '*') sum += (arr[i] - 1) * (arr2[j] - 1);
    }
  }
  cout << sum;
}
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
