#include <bits/stdc++.h>
using namespace std;
int n, m;
char a[1010][1010];
int b[1010][1010];
int c[1010][1010];
int d[1010][1010];
int e[1010][1010];
int main() {
  while (scanf("%d%d", &n, &m) == 2) {
    for (int i = 0; i < n; i++) {
      scanf("%s", a[i]);
    }
    memset(b, 0, sizeof(b));
    memset(c, 0, sizeof(c));
    memset(d, 0, sizeof(d));
    memset(e, 0, sizeof(e));
    for (int i = 0; i < n; i++) {
      int t = 0;
      for (int j = 0; j < m; j++) {
        if (a[i][j] == '*') {
          t++;
          b[i][j] = t;
        }
      }
    }
    for (int j = 0; j < m; j++) {
      int k = 0;
      for (int i = 0; i < n; i++) {
        if (a[i][j] == '*') {
          k++;
          c[i][j] = k;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      int t = 0;
      for (int j = m - 1; j >= 0; j--) {
        if (a[i][j] == '*') {
          t++;
          d[i][j] = t;
        }
      }
    }
    for (int j = m - 1; j >= 0; j--) {
      int k = 0;
      for (int i = n - 1; i >= 0; i--) {
        if (a[i][j] == '*') {
          k++;
          e[i][j] = k;
        }
      }
    }
    long long s = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (a[i][j] == '*') {
          if (b[i][j] > 1) {
            if (c[i][j] > 1) s += (b[i][j] - 1) * (c[i][j] - 1);
            if (e[i][j] > 1) s += (b[i][j] - 1) * (e[i][j] - 1);
          }
          if (d[i][j] > 1) {
            if (c[i][j] > 1) s += (d[i][j] - 1) * (c[i][j] - 1);
            if (e[i][j] > 1) s += (d[i][j] - 1) * (e[i][j] - 1);
          }
        }
      }
    }
    printf("%lld\n", s);
  }
  return 0;
}
