#include <bits/stdc++.h>
using namespace std;
char mp;
bool bmp[1000][1000];
long long stb[1000] = {0}, stl[1000] = {0};
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> mp;
      if (mp == '*') ++stb[j], ++stl[i], bmp[i][j] = true;
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      ans += (bmp[i][j] && stl[i] > 1 ? (stl[i] - 1) * (stb[j] - 1) : 0);
    }
  }
  cout << ans;
  return 0;
}
