#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
bool t[2000][2000];
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> a(n, 0), b(m, 0);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      char c;
      cin >> c;
      if (c == '*') {
        a[i]++;
        b[j]++;
        t[i][j] = true;
      }
    }
  long long r = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (t[i][j]) r += (a[i] - 1) * (b[j] - 1);
  cout << r << endl;
}
