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;
char a[1010][1010];
int n, m, k;
vector<pair<pair<int, int>, pair<int, int> > > r;
vector<int> px;
long long S;
int main() {
  scanf("%d%d%d", &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] == '*') {
        int i1 = i, j1 = j;
        while (a[i1][j] == '*') i1++;
        i1--;
        while (a[i][j1] == '*') j1++;
        j1--;
        for (int k = i; k <= i1; k++)
          for (int l = j; l <= j1; l++) a[k][l] = '.';
        r.push_back(make_pair(make_pair(i, j), make_pair(i1, j1))),
            px.push_back(i), px.push_back(i1);
      }
  px.push_back(0), sort(px.begin(), px.end()),
      px.erase(unique(px.begin(), px.end()), px.end());
  for (int i = 0; i < (int)px.size(); i++)
    for (int j = i; j < (int)px.size(); j++) {
      int lw = px[i], rw = px[j];
      vector<pair<int, int> > py;
      for (int k = 0; k < (int)r.size(); k++)
        if (lw <= r[k].first.first && r[k].first.first <= rw ||
            lw <= r[k].second.first && r[k].second.first <= rw ||
            r[k].first.first <= lw && rw <= r[k].second.first)
          if (lw <= r[k].first.first && r[k].second.first <= rw)
            py.push_back(make_pair(r[k].first.second, -1)),
                py.push_back(make_pair(r[k].second.second, 1));
          else
            py.push_back(make_pair(r[k].first.second, -100)),
                py.push_back(make_pair(r[k].second.second, 100));
      py.push_back(make_pair(0, 0)), sort(py.begin(), py.end());
      for (int C = 1; C <= 3; C++)
        for (int l = 0, r = 0, c = 0, sr = 0, sl = 0; l < (int)py.size(); l++) {
          while (r < (int)py.size() && (sr != 0 || c < C))
            c += max(py[r].second, 0), sr += py[r++].second;
          if (c == C && sl == 0 && sr == 0)
            S += (long long)(i == 0 ? 1 : px[i] - px[i - 1]) *
                 (j == (int)px.size() - 1 ? n - px[j] : px[j + 1] - px[j]) *
                 (l == 0 ? 1 : py[l].first - py[l - 1].first) *
                 (r == (int)py.size() ? m - py[r - 1].first
                                      : py[r].first - py[r - 1].first);
          c -= max(py[l].second, 0), sl += py[l].second;
        }
    }
  printf("%I64d\n", S);
  return 0;
}