#include <bits/stdc++.h>
using namespace std;
const int maxn = 505;
char a[maxn][maxn];
int s[maxn][maxn];
int n, m, k;
void init() {
  memset(s, 0, sizeof(s));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] == '1' && a[i - 1][j] == '1' && a[i + 1][j] == '1' &&
          a[i][j - 1] == '1' && a[i][j + 1] == '1')
        s[i][j] = s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1] + 1;
      else
        s[i][j] = s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1];
}
int calc(int x1, int x2, int y1, int y2) {
  return s[x2][y2] - s[x1 - 1][y2] - s[x2][y1 - 1] + s[x1 - 1][y1 - 1];
}
int main() {
  int i, x1, x2, y1;
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    for (i = 1; i <= n; i++) scanf("%s", &a[i][1]);
    init();
    long long way = 0;
    for (x1 = 1; x1 < n; x1++)
      for (x2 = x1 + 2; x2 <= n; x2++) {
        for (y1 = 1; y1 < m; y1++) {
          int l = y1 + 2, r = m, ans = -1;
          while (l <= r) {
            int mid = (l + r) / 2;
            if (calc(x1 + 1, x2 - 1, y1 + 1, mid - 1) >= k) {
              ans = mid;
              r = mid - 1;
            } else
              l = mid + 1;
          }
          if (ans != -1) way += (long long)(m - ans + 1);
        }
      }
    printf("%I64d\n", way);
  }
  return 0;
}
