#include <bits/stdc++.h>
using namespace std;
char ch[1000][1000];
long arr1[1000], arr2[1000];
int main(int argc, const char* argv[]) {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    int coun = 0;
    for (long long j = 0; j < m; j++) {
      cin >> ch[i][j];
      if (ch[i][j] == '*') coun++;
    }
    arr1[i] = coun;
  }
  for (long long i = 0; i < m; i++) {
    long long coun = 0;
    for (long long j = 0; j < n; j++) {
      if (ch[j][i] == '*') coun++;
    }
    arr2[i] = coun;
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (ch[i][j] == '*') {
        ans += (arr1[i] - 1) * (arr2[j] - 1);
      }
    }
  }
  cout << ans << endl;
}
