#include <bits/stdc++.h>
using namespace std;
char a[1005][1005];
int b[1005][1005];
int Q[2000005];
int L[105], R[105], D[105], U[105];
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
void go(int x, int y, int w) {
  b[x][y] = w;
  int qb = 0, qe = 0;
  L[w] = R[w] = x;
  D[w] = U[w] = y;
  Q[qe++] = x;
  Q[qe++] = y;
  while (qb < qe) {
    x = Q[qb++];
    y = Q[qb++];
    for (int k = 0; k < 4; k++)
      if (a[x + dx[k]][y + dy[k]] == '*' && b[x + dx[k]][y + dy[k]] == 0) {
        b[x + dx[k]][y + dy[k]] = w;
        L[w] = min(L[w], x + dx[k]);
        R[w] = max(R[w], x + dx[k]);
        U[w] = max(U[w], y + dy[k]);
        D[w] = min(D[w], y + dy[k]);
        Q[qe++] = x + dx[k];
        Q[qe++] = y + dy[k];
      }
  }
}
int n, m, k;
long long ans;
int LDY[1005], LUY[1005], LDX[1005], RDX[1005];
int RUX[1005], RUY[1005], gsum[1005];
void chk(int p, int q, int s) {
  int l, r, d, u, ll, rr, dd, uu;
  l = min(L[p], min(L[q], L[s]));
  r = max(R[p], max(R[q], R[s]));
  d = min(D[p], min(D[q], D[s]));
  u = max(U[p], max(U[q], U[s]));
  ll = 0;
  rr = n + 1;
  dd = 0;
  uu = m + 1;
  for (int i = 1; i <= k; i++) {
    if (i == p || i == q || i == s) continue;
    if (R[i] >= l && L[i] <= r) {
      if (U[i] < d)
        dd = max(dd, U[i]);
      else if (D[i] > u)
        uu = min(uu, D[i]);
      else
        return;
    }
    if (U[i] >= d && D[i] <= u) {
      if (R[i] < l)
        ll = max(ll, R[i]);
      else if (L[i] > r)
        rr = min(rr, L[i]);
      else
        return;
    }
  }
  for (int x = ll + 1; x <= l; x++) LDY[x] = dd + 1, LUY[x] = uu - 1;
  for (int y = dd + 1; y <= d; y++) LDX[y] = ll + 1, RDX[y] = rr - 1;
  for (int x = r; x < rr; x++) RUY[x] = uu - 1;
  for (int y = u; y < uu; y++) RUX[y] = rr - 1;
  for (int i = 1; i <= k; i++) {
    if (i == p || i == q || i == s) continue;
    if (R[i] < l && U[i] < d) {
      LDY[R[i]] = max(LDY[R[i]], U[i] + 1);
      LDX[U[i]] = max(LDX[U[i]], R[i] + 1);
    } else if (R[i] < l && D[i] > u) {
      LUY[R[i]] = min(LUY[R[i]], D[i] - 1);
    } else if (L[i] > r && U[i] < d) {
      RDX[U[i]] = min(RDX[U[i]], L[i] - 1);
    } else if (L[i] > r && D[i] > u) {
      RUY[L[i]] = min(RUY[L[i]], D[i] - 1);
      RUX[D[i]] = min(RUX[D[i]], L[i] - 1);
    }
  }
  for (int x = l - 1; x > ll; x--) {
    LDY[x] = max(LDY[x], LDY[x + 1]);
    LUY[x] = min(LUY[x], LUY[x + 1]);
  }
  for (int y = d - 1; y > dd; y--) {
    LDX[y] = max(LDX[y], LDX[y + 1]);
    RDX[y] = min(RDX[y], RDX[y + 1]);
  }
  for (int x = r + 1; x < rr; x++) RUY[x] = min(RUY[x], RUY[x - 1]);
  for (int y = u + 1; y < uu; y++) RUX[y] = min(RUX[y], RUX[y - 1]);
  gsum[r] = 0;
  for (int x = r + 1; x < rr; x++) gsum[x] = gsum[x - 1] + (RUY[x] - u + 1);
  for (int x = ll + 1; x <= l; x++)
    for (int y = LDY[x]; y <= d; y++) {
      int yu = LUY[x];
      int xr = RDX[y];
      int xyu = RUX[yu];
      if (xr <= xyu) {
        ans += 1LL * (yu - u + 1) * (xr - r + 1);
      } else {
        ans += 1LL * (yu - u + 1) * (xyu - r + 1) + gsum[xr] - gsum[xyu];
      }
    }
}
int main(void) {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  int w = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] == '*' && b[i][j] == 0) {
        go(i, j, ++w);
      }
  ans = 0;
  for (int i = 1; i <= w; i++) chk(i, i, i);
  for (int i = 1; i <= w; i++)
    for (int j = i + 1; j <= w; j++) chk(i, j, j);
  for (int i = 1; i <= w; i++)
    for (int j = i + 1; j <= w; j++)
      for (int e = j + 1; e <= w; e++) chk(i, j, e);
  printf("%I64d\n", ans);
  return 0;
}
