#include <bits/stdc++.h>
using namespace std;
char tbl[1024][1024];
long long x[1024], y[1024];
int n, m;
long long ans;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> tbl[i][j];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (tbl[i][j] == '*') x[j]++, y[i]++;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (tbl[i][j] == '*') ans += (x[j] - 1) * (y[i] - 1);
  cout << ans << endl;
}
