#include <bits/stdc++.h>
using namespace std;
char a[1010][1010];
int s[1010][1010][5];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  memset(s, 0, sizeof(s));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      s[i][j][1] = s[i - 1][j][1] + (a[i][j] == '*');
      s[i][j][4] = s[i][j - 1][4] + (a[i][j] == '*');
    }
  for (int i = n; i; i--)
    for (int j = m; j; j--) {
      s[i][j][2] = s[i][j + 1][2] + (a[i][j] == '*');
      s[i][j][3] = s[i + 1][j][3] + (a[i][j] == '*');
    }
  long long ans = 0LL;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] == '*')
        for (int x = 1; x <= 4; x++) {
          int y = (x == 4) ? 1 : x + 1;
          ans += (long long)max(0, s[i][j][x] - 1) *
                 (long long)max(0, s[i][j][y] - 1);
        }
  cout << ans << endl;
  return 0;
}
