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;
pair<pair<int, int>, pair<int, int> > r[111];
vector<int> dx;
char a[1111][1111];
int n, m, k;
int main() {
  gets(a[0]);
  sscanf(a[0], "%d%d%d", &n, &m, &k);
  k = 0;
  for (int(i) = 0; (i) < (n); ++(i)) gets(a[i]);
  for (int(i) = 0; (i) < (n); ++(i))
    for (int(j) = 0; (j) < (m); ++(j))
      if (a[i][j] == '*') {
        int ii = i, jj = j;
        while (a[i][jj] == '*') ++jj;
        while (a[ii][j] == '*') ++ii;
        r[k++] = make_pair(make_pair(i, --ii), make_pair(j, --jj));
        dx.push_back(i);
        dx.push_back(ii);
        for (int t = i; t <= ii; ++t)
          for (int tt = j; tt <= jj; ++tt) a[t][tt] = '.';
      }
  dx.push_back(0);
  sort((dx).begin(), (dx).end());
  dx.resize(unique((dx).begin(), (dx).end()) - dx.begin());
  long long ans = 0;
  for (int st = 0; st < (int)dx.size(); ++st)
    for (int fn = st; fn < (int)dx.size(); ++fn) {
      int si = dx[st];
      int fi = dx[fn];
      vector<pair<int, int> > dy;
      for (int(i) = 0; (i) < (k); ++(i))
        if ((r[i].first.first >= si && r[i].first.first <= fi) ||
            (r[i].first.second >= si && r[i].first.second <= fi) ||
            (r[i].first.first <= si && r[i].first.second >= fi)) {
          if (r[i].first.first >= si && r[i].first.second <= fi) {
            dy.push_back(make_pair(r[i].second.first, -1));
            dy.push_back(make_pair(r[i].second.second, 1));
          } else {
            dy.push_back(make_pair(r[i].second.first, -100));
            dy.push_back(make_pair(r[i].second.second, +100));
          }
        }
      dy.push_back(make_pair(0, 0));
      sort((dy).begin(), (dy).end());
      for (int num = 1; num <= 3; ++num) {
        int j = 0;
        int glo = 0;
        int cglo = 0;
        int bi = 0;
        int bj = 0;
        for (int i = 0; i < (int)dy.size(); ++i) {
          while (j < (int)dy.size() && !(cglo - glo >= num && bj == 0)) {
            if (dy[j].second > 0) cglo += dy[j].second;
            bj += dy[j++].second;
          }
          if (cglo - glo == num && bj == 0 && bi == 0) {
            int m1, m2, m3, m4;
            if (!st)
              m1 = 1;
            else
              m1 = si - dx[st - 1];
            if (!i)
              m3 = 1;
            else
              m3 = (dy[i].first - dy[i - 1].first);
            if (fn < (int)dx.size() - 1)
              m2 = dx[fn + 1] - fi;
            else
              m2 = n - fi;
            if (j == (int)dy.size())
              m4 = m - dy.back().first;
            else
              m4 = dy[j].first - dy[j - 1].first;
            ans += (long long)m1 * m2 * m3 * m4;
          }
          if (dy[i].second > 0) glo += dy[i].second;
          bi += dy[i].second;
        }
      }
    }
  cout << ans << endl;
}