#include <bits/stdc++.h>
int diru[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dirv[] = {-1, 0, 1, -1, 1, -1, 0, 1};
using namespace std;
template <class T>
T sq(T n) {
  return n * n;
}
template <class T>
T gcd(T a, T b) {
  return (b != 0 ? gcd<T>(b, a % b) : a);
}
template <class T>
T lcm(T a, T b) {
  return (a / gcd<T>(a, b) * b);
}
template <class T>
bool inside(T a, T b, T c) {
  return a <= b && b <= c;
}
template <class T>
void setmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
void setmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
T power(T N, T P) {
  return (P == 0) ? 1 : N * power(N, P - 1);
}
long long unsigned dpr[1010][1010];
long long unsigned dpu[1010][1010];
char in[1010][1010];
char tmp[1010][1010];
int r, c;
long long unsigned solve() {
  int i, j;
  for (i = 0; i < r; i++) {
    dpr[i][c] = 0;
    for (j = c - 1; j > -1; j--) {
      dpr[i][j] = dpr[i][j + 1];
      if (in[i][j] == '*') dpr[i][j]++;
    }
  }
  for (j = 0; j < c; j++) {
    dpu[0][j] = 0;
    if (in[0][j] == '*') dpu[0][j]++;
    for (i = 1; i < r; i++) {
      dpu[i][j] = dpu[i - 1][j];
      if (in[i][j] == '*') dpu[i][j]++;
    }
  }
  long long unsigned ret = 0;
  for (i = 0; i < r; i++)
    for (j = 0; j < c; j++) {
      if (in[i][j] == '.') continue;
      ret += (dpr[i][j] - (long long unsigned)1) *
             (dpu[i][j] - (long long unsigned)1);
    }
  return ret;
}
void rot() {
  int i, j;
  for (i = 0; i < r; i++)
    for (j = 0; j < c; j++) {
      tmp[c - j - 1][i] = in[i][j];
    }
  swap(r, c);
  for (i = 0; i < r; i++)
    for (j = 0; j < c; j++) in[i][j] = tmp[i][j];
}
int main() {
  int n, T, t = 1, m, i, j, k;
  scanf("%d", &r);
  scanf("%d", &c);
  for (i = 0; i < r; i++) scanf("%s", in[i]);
  long long unsigned ans = 0;
  ans += solve();
  rot();
  ans += solve();
  rot();
  ans += solve();
  rot();
  ans += solve();
  cout << ans << endl;
  return 0;
}
