#include <bits/stdc++.h>
using namespace std;
inline void read(register int *n) {
  register char c;
  *n = 0;
  do {
    c = getchar();
  } while (c < '0' || c > '9');
  do {
    *n = c - '0' + *n * 10;
    c = getchar();
  } while (c >= '0' && c <= '9');
}
int R, C, K;
inline int cnt(const vector<int> &V) {
  int n = ((int)(V).size());
  int lo, hi, tot = 0, res = 0;
  lo = 1, hi = 0;
  while (lo < n - 1) {
    while (hi + 1 < n - 1 && tot < K) hi++, tot += V[hi];
    if (tot >= K) res += ((int)(V).size()) - hi - 1;
    tot -= V[lo];
    lo++;
  }
  return res;
}
int board[550][550];
string s[550];
int main() {
  cin >> R >> C >> K;
  for (register int i = (0); i < (int)(R); ++i) cin >> s[i];
  for (register int i = (1); i < (int)(R - 1); ++i)
    for (register int j = (1); j < (int)(C - 1); ++j)
      if (s[i][j] % 2 && s[i - 1][j] % 2 && s[i + 1][j] % 2 &&
          s[i][j - 1] % 2 && s[i][j + 1] % 2)
        board[i][j] = 1;
  for (register int i = (0); i < (int)(R); ++i)
    for (register int j = (1); j < (int)(C); ++j)
      board[i][j] += board[i][j - 1];
  long long tot = 0;
  for (register int left = (0); left < (int)(C); ++left)
    for (register int right = (left + 2); right < (int)(C); ++right) {
      vector<int> arr;
      for (register int i = (0); i < (int)(R); ++i)
        arr.push_back(board[i][right - 1] - board[i][left]);
      tot += cnt(arr);
    }
  cout << tot << "\n";
  return 0;
}
