#include <bits/stdc++.h>
const int LMT = 1002;
using namespace std;
long long v[LMT];
char gra[LMT][LMT];
int main() {
  int n, m;
  long long ans = 0, cur;
  cin >> n >> m;
  for (int i = 0; i < n; i++) scanf("%s", gra[i]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (gra[i][j] == '*') v[j]++;
  for (int i = 0; i < n; i++) {
    cur = 0;
    for (int j = 0; j < m; j++)
      if (gra[i][j] == '*') {
        cur++;
        ans += (cur - 1) * (v[j] - 1);
      }
    cur = 0;
    for (int j = m - 1; j >= 0; j--)
      if (gra[i][j] == '*') {
        cur++;
        ans += (cur - 1) * (v[j] - 1);
      }
  }
  cout << ans << endl;
  return 0;
}
