#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long double PI = acos(-1.0);
template <typename T>
T gcd(T a, T b) {
  if (b > a) return gcd(b, a);
  return b == 0 ? a : gcd(b, a % b);
}
template <typename T>
T lcm(T a, T b) {
  return a * b / gcd(a, b);
}
template <typename T>
T fast_power(T x, T y, long long m) {
  T ans = 1;
  while (y > 0) {
    if (y & 1LL) ans = (ans * x) % m;
    y >>= 1LL;
    x = (x * x) % m;
  }
  return ans % m;
}
template <typename X>
inline X abs(const X& a) {
  return a < 0 ? -a : a;
}
template <typename X>
inline X sqr(const X& a) {
  return a * a;
}
template <typename T>
inline string toStr(T x) {
  stringstream st;
  st << x;
  string s;
  st >> s;
  return s;
}
bool isprime(long long a) {
  if (a == 2) {
    return 1;
  }
  if (!(a & 1)) {
    return 0;
  }
  for (long long i = 3; i * i <= a; i += 2) {
    if (a % i == 0) {
      return 0;
    }
  }
  return 1;
}
template <typename T>
T modDiv(T a, T b, T MD) {
  return a * fast_power(b, MD - 2, MD) % MD;
}
template <typename T>
T extgcd(T a, T b, T& x, T& y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  T p = b / a;
  T g = extgcd(b - p * a, a, y, x);
  x -= p * y;
  return g;
}
long long inv(long long a, long long m) {
  long long x, y;
  extgcd(a, m, x, y);
  return (x + m) % m;
}
template <typename T>
T largestPower(T n, T p) {
  T total = 0;
  while (n) {
    n /= p;
    total += n;
  }
  return total;
}
int doublecomp(double a, double b) {
  if ((a - b) <= 0.0000000001) {
    return 1;
  } else {
    return 0;
  }
}
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
const int INF = 1 << 30;
const long long LINF = 1ll << 60;
template <typename T>
T inf() {
  return (T)__builtin_inf();
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> Rcnt(n + 1, 0);
  vector<int> Ccnt(m + 1, 0);
  char matrix[n + 1][m + 1];
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      cin >> matrix[i][j];
      if (matrix[i][j] == '*') {
        Ccnt[j] += 1;
        Rcnt[i] += 1;
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    int c, r;
    for (int j = 1; j <= m; ++j) {
      c = Ccnt[j] - (matrix[i][j] == '*' ? 1 : 0);
      r = Rcnt[i] - (matrix[i][j] == '*' ? 1 : 0);
      if (matrix[i][j] == '*') {
        ans += r * c;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}
