#include <bits/stdc++.h>
using namespace std;
template <class T>
void checkmin(T &t, T x) {
  if (x < t) t = x;
}
template <class T>
void checkmax(T &t, T x) {
  if (x > t) t = x;
}
template <class T>
void _checkmin(T &t, T x) {
  if (t == -1) t = x;
  if (x < t) t = x;
}
template <class T>
void _checkmax(T &t, T x) {
  if (t == -1) t = x;
  if (x > t) t = x;
}
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;
}
