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;
const int N = 1111;
int n, m, k;
char a[N][N];
using S = pair<int, int>;
vector<S> st[N], ed[N], p, q;
void fs(int x, int y) {
  int ny = y;
  while (ny < m && a[x][ny] == '*') ++ny;
  int nx = x;
  while (nx < n && a[nx][y] == '*') ++nx;
  st[x].emplace_back(y, 1);
  st[x].emplace_back(ny, -1);
  ed[nx].emplace_back(y, 1);
  ed[nx].emplace_back(ny, -1);
  for (int i = x; i < nx; ++i)
    for (int j = y; j < ny; ++j) a[i][j] = '#';
}
void debug(const vector<S>& q) {
  for (const auto eq : q) {
    cerr << eq.first << "," << eq.second << "   ";
  }
  cerr << endl;
}
int main() {
  scanf("%d%d%d\n ", &n, &m, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%s", a[i]);
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (a[i][j] == '*') fs(i, j);
  for (int i = 0; i <= n; ++i) {
    sort(ed[i].begin(), ed[i].end());
  }
  int64_t ans = 0;
  p = {};
  for (int i = 0; i < n; ++i) {
    vector<S> np;
    size_t k = 0;
    const auto& ei = ed[i];
    for (const auto& ep : p) {
      bool to_delete = false;
      while (k < ei.size() && ei[k].first < ep.first) ++k;
      if (k < ei.size() && ei[k].first == ep.first) {
        if ((ep.second > 0) == (ei[k].second > 0)) {
          to_delete = true;
          ++k;
        }
      }
      if (!to_delete)
        np.emplace_back(ep.first,
                        ep.second > 0 ? ep.second + 1 : ep.second - 1);
    }
    for (const auto& es : st[i]) np.emplace_back(es.first, es.second * 100);
    sort(np.begin(), np.end());
    swap(p, np);
    q = p;
    q.emplace_back(m, 0);
    for (int j = i; j < n; ++j) {
      const auto& ej = ed[j + 1];
      k = 0;
      for (auto& eq : q) {
        while (k < ej.size() && ej[k].first < eq.first) ++k;
        if (k < ej.size() && ej[k].first == eq.first) {
          if (eq.second == 100 && ej[k].second == 1) {
            eq.second = 1;
            ++k;
          }
          if (eq.second == -100 && ej[k].second == -1) {
            eq.second = -1;
            ++k;
          }
        }
      }
      k = 0;
      int lv = 0, f[3] = {0, 0, 0};
      for (auto& eq : q) {
        int64_t slots = 0;
        if (!lv) {
          slots = eq.first - k + 1;
          ans += slots * (f[0] + f[1] + f[2]);
        }
        k = eq.first;
        if (eq.second > 1) {
          f[0] = f[1] = f[2] = 0;
        } else if (eq.second == 1) {
          f[2] = f[1];
          f[1] = f[0];
          f[0] = slots;
        }
        lv += eq.second;
      }
      vector<S> nq;
      const auto& es = st[j + 1];
      k = 0;
      for (const auto& eq : q) {
        while (k < es.size() && es[k] < eq) {
          nq.emplace_back(es[k].first, es[k].second * 100);
          ++k;
        }
        nq.push_back(eq);
      }
      swap(q, nq);
    }
  }
  cout << ans << endl;
}