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;
typedef struct _Object {
  int x1, y1, x2, y2;
} Object;
typedef struct _Line {
  int x;
  int belong;
  int kind;
} Line;
typedef struct _Segment {
  int left, right, nCoveredObject;
} Segment;
const int hang[4] = {-1, 0, 1, 0};
int cot[4] = {0, 1, 0, -1};
Object *List;
Object *savedList;
Line *ListLine, *savedListLine;
Segment *ListSegment, *savedListSegment;
int m, n, k, nListSegment;
long long res;
char **table;
void getInput() {
  scanf("%d%d%d\n", &m, &n, &k);
  table = new char *[m + 1];
  for (int i = 0; i <= m - 1; i++) {
    table[i] = new char[n + 1];
    gets(table[i]);
  }
}
void DFS(int i, int j) {
  table[i][j] = '.';
  List->x1 = min(List->x1, i);
  List->x2 = max(List->x2, i);
  List->y1 = min(List->y1, j);
  List->y2 = max(List->y2, j);
  for (int t = 0; t <= 3; t++) {
    int x = i + hang[t];
    int y = j + cot[t];
    if (0 <= x && x < m && 0 <= y && y < n)
      if (table[x][y] == '*') DFS(x, y);
  }
}
void buildList() {
  List = (Object *)malloc(sizeof(Object) * 100);
  ListLine = (Line *)malloc(sizeof(Line) * 100 * 2);
  savedList = List;
  savedListLine = ListLine;
  int count = 0;
  for (int i = 0; i <= m - 1; i++)
    for (int j = 0; j <= n - 1; j++)
      if (table[i][j] == '*') {
        List->x1 = 10000000;
        List->x2 = -10000000;
        List->y1 = 10000000;
        List->y2 = -10000000;
        DFS(i, j);
        ListLine->belong = count;
        ListLine->kind = 0;
        ListLine->x = List->y1;
        ++ListLine;
        ListLine->belong = count;
        ListLine->kind = 1;
        ListLine->x = List->y2;
        ++count;
        ++ListLine;
        ++List;
      }
  ListLine = savedListLine;
  List = savedList;
}
int cmp(Line a, Line b) {
  return (a.x < b.x || (a.x == b.x && a.kind < b.kind));
}
void sortListLine() { sort(ListLine, ListLine + 2 * k, cmp); }
int cutStrip(Line a, int up, int down) {
  return (!(List[a.belong].x2 < up || List[a.belong].x1 > down));
}
int belongToStrip(Line a, int up, int down) {
  return ((List[a.belong].x1 >= up) && (List[a.belong].x2 <= down));
}
long long pre(int j) {
  if (j == 0)
    return ((long long)(ListSegment[j].left + 1));
  else
    return ((long long)(ListSegment[j].left - ListSegment[j - 1].right));
}
long long next(int i) {
  if (i == nListSegment - 1)
    return ((long long)(n - 1 - ListSegment[i].right + 1));
  else
    return ((long long)(ListSegment[i + 1].left - ListSegment[i].right));
}
void Solve(int up, int down) {
  int nTempObject;
  for (int i = 0; i <= nListSegment - 1; i++) {
    nTempObject = 0;
    for (int j = i; j >= max(0, i - 2); j--) {
      nTempObject += ListSegment[j].nCoveredObject;
      if (nTempObject > 3) break;
      res += pre(j) * next(i);
    }
  };
}
void solve(int up, int down) {
  int nCurrentObject = 0;
  nListSegment = 0;
  ListSegment = savedListSegment;
  ListSegment->nCoveredObject = 0;
  for (int i = 0; i <= 2 * k - 1; i++)
    if (cutStrip(ListLine[i], up, down)) {
      if (ListLine[i].kind == 0) {
        if (nCurrentObject == 0) {
          ListSegment->left = ListLine[i].x;
        }
        ++nCurrentObject;
        if (belongToStrip(ListLine[i], up, down))
          ListSegment->nCoveredObject++;
        else
          ListSegment->nCoveredObject += 10000000;
      } else {
        --nCurrentObject;
        if (nCurrentObject == 0) {
          ListSegment->right = ListLine[i].x;
          nListSegment++;
          ListSegment = ListSegment + 1;
          ListSegment->nCoveredObject = 0;
        }
      }
    }
  ListSegment = savedListSegment;
  Solve(up, down);
}
int main() {
  getInput();
  buildList();
  sortListLine();
  res = 0;
  ListSegment = (Segment *)malloc(sizeof(Segment) * 100);
  savedListSegment = ListSegment;
  for (int i = 0; i <= m - 1; i++)
    for (int j = i; j <= m - 1; j++) solve(i, j);
  printf("%I64d", res);
  return 0;
}