Problem: You take part in the testing of new weapon. For the testing a polygon was created. The polygon is a rectangular field n × m in size, divided into unit squares 1 × 1 in size. The polygon contains k objects, each of which is a rectangle with sides, parallel to the polygon sides and entirely occupying several unit squares. The objects don't intersect and don't touch each other.

The principle according to which the weapon works is highly secret. You only know that one can use it to strike any rectangular area whose area is not equal to zero with sides, parallel to the sides of the polygon. The area must completely cover some of the unit squares into which the polygon is divided and it must not touch the other squares. Of course the area mustn't cross the polygon border. Your task is as follows: you should hit no less than one and no more than three rectangular objects. Each object must either lay completely inside the area (in that case it is considered to be hit), or lay completely outside the area.

Find the number of ways of hitting.

Input

The first line has three integers n, m и k (1 ≤ n, m ≤ 1000, 1 ≤ k ≤ 90) — the sizes of the polygon and the number of objects on it respectively. Next n lines contain m symbols each and describe the polygon. The symbol "*" stands for a square occupied an object, whereas the symbol "." stands for an empty space. The symbols "*" form exactly k rectangular connected areas that meet the requirements of the task.

Output

Output a single number — the number of different ways to hit a target.

Examples

Input

3 3 3
*.*
...
*..


Output

21


Input

4 5 4
.*.**
...**
**...
...**


Output

38


Input

2 2 1
.*
..


Output

4

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int N, M, K, Xn, Yn;
char G[1010][1010], T[200][200];
vector<int> X, Y;
int psum[200][200], csum[200][200];
void prop(int (*psum)[200]) {
  for (int i = 0; i < Yn; i++) {
    for (int j = 0; j < Xn; j++) {
      if (i) psum[i][j] += psum[i - 1][j];
      if (j) psum[i][j] += psum[i][j - 1];
      if (i && j) psum[i][j] -= psum[i - 1][j - 1];
    }
  }
}
int calc(int r1, int c1, int r2, int c2, int (*psum)[200]) {
  int ret = psum[r2][c2];
  if (r1) ret -= psum[r1 - 1][c2];
  if (c1) ret -= psum[r2][c1 - 1];
  if (r1 && c1) ret += psum[r1 - 1][c1 - 1];
  return ret;
}
int A[200], B[200];
int main() {
  scanf("%d %d %d", &N, &M, &K);
  for (int i = 0; i < N; i++) {
    scanf("\n");
    for (int j = 0; j < M; j++) {
      scanf("%c", &G[i][j]);
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      if (i == 0 || G[i - 1][j] != G[i][j]) Y.push_back(i);
      if (j == 0 || G[i][j - 1] != G[i][j]) X.push_back(j);
    }
  }
  sort(X.begin(), X.end());
  sort(Y.begin(), Y.end());
  X.resize(unique(X.begin(), X.end()) - X.begin());
  Y.resize(unique(Y.begin(), Y.end()) - Y.begin());
  Xn = X.size();
  Yn = Y.size();
  X.push_back(M);
  Y.push_back(N);
  for (int i = 0; i < Yn; i++) {
    for (int j = 0; j < Xn; j++) {
      T[i][j] = G[Y[i]][X[j]];
    }
  }
  for (int i = 0; i < Yn; i++) {
    for (int j = 0; j < Xn; j++) {
      if (T[i][j] == '.') continue;
      psum[i][j] = 2;
      if ((i && T[i - 1][j] == '*') || (j && T[i][j - 1] == '*')) psum[i][j]--;
      if ((i != Yn - 1 && T[i + 1][j] == '*') ||
          (j != Xn - 1 && T[i][j + 1] == '*'))
        psum[i][j]--;
      csum[i][j] = 1;
      if (j == 0 || T[i][j - 1] == '.') csum[i][j] = 0;
    }
  }
  prop(psum);
  prop(csum);
  long long ans = 0;
  for (int i = 0; i < Yn; i++) {
    for (int j = i; j < Yn; j++) {
      for (int a = 0; a < Xn; a++) {
        A[a] = calc(i, a, j, a, psum);
      }
      for (int a = 0; a < Xn; a++) {
        B[a] = calc(i, a, j, a, csum);
      }
      for (int a = 0; a < Xn; a++) {
        int t = Y[i + 1] - Y[i];
        int d = Y[j + 1] - Y[j];
        int l = calc(i, a, j, a, psum) ? 1 : X[a + 1] - X[a];
        int r;
        if (B[a]) continue;
        int tmp = 0;
        for (int b = a; b < Xn; b++) {
          if (T[i][b] == '*') t = 1;
          if (T[j][b] == '*') d = 1;
          if (i && T[i - 1][b] == '*' && T[i][b] == '*') break;
          if (j < Yn - 1 && T[j][b] == '*' && T[j + 1][b] == '*') break;
          tmp += A[b];
          if (b < Xn - 1 && B[b + 1]) continue;
          if (tmp > 6) break;
          if (2 <= tmp && tmp <= 6) {
            r = A[b] ? 1 : X[b + 1] - X[b];
            ans += 1LL * t * d * l * r;
          }
        }
      }
    }
  }
  printf("%lld", ans);
}