#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int m, n, row[1010], col[1010], ans = 0, sum = 0;
  char a[1010][1010];
  cin >> m >> n;
  memset(row, 0, sizeof row);
  memset(col, 0, sizeof col);
  for (long long int i = 0; i < m; i++)
    for (long long int j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] == '*') {
        row[i]++;
        col[j]++;
      }
    }
  for (long long int i = 0; i < n; i++) {
    sum = 0;
    for (long long int j = 0; j < m; j++) {
      if (a[j][i] == '*') sum = sum + row[j] - 1;
    }
    ans = ans + sum * (col[i] - 1);
  }
  cout << ans;
}
