#include <bits/stdc++.h>
using namespace std;
long long heng[1100], lie[1100], num[1100][1100], ans, i, j, n, m;
char c;
int main() {
  scanf("%I64d%I64d\n", &n, &m);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      scanf("%c", &c);
      if (c == '*') {
        num[i][j] = 1;
        heng[i]++;
        lie[j]++;
      }
    }
    scanf("\n");
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (num[i][j] == 1) ans += (heng[i] - 1) * (lie[j] - 1);
  printf("%I64d\n", ans);
}
