#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;
}
