#include <bits/stdc++.h>
const int N = 510;
int DP[N][N], t[N][N], n, m, k;
int dx[] = {-2, -1, -1, -1, 0}, dy[] = {-1, -2, -1, 0, -1};
char map[N][N];
bool ok(int a, int b) {
  for (int i = 0; i < 5; i++)
    if (map[a + dx[i]][b + dy[i]] == '0') return 0;
  return 1;
}
bool ok(int mid, int i, int j, int l) {
  if (DP[j][l] - DP[i - 1][l] - DP[j][mid + 1] + DP[i - 1][mid + 1] >= k)
    return 1;
  return 0;
}
int bs(int l, int u, int i, int j) {
  int low = l, up = u, mid;
  while (low <= up) {
    mid = (low + up) / 2;
    if (ok(mid, i, j, l)) {
      if (mid == l || !ok(mid - 1, i, j, l)) return mid;
      up = mid - 1;
    } else
      low = mid + 1;
  }
  return m;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++) scanf("%s", map[i]);
  for (int i = 2; i < n; i++)
    for (int j = 2; j < m; j++)
      if (ok(i, j)) t[i][j] = 1;
  for (int i = 2; i < n; i++)
    for (int j = m - 1; j >= 2; j--)
      DP[i][j] = DP[i - 1][j] + DP[i][j + 1] - DP[i - 1][j + 1] + t[i][j];
  long long ans = 0;
  for (int i = 2; i < n; i++)
    for (int j = i; j < n; j++)
      for (int s = 2; s < m; s++) ans += m - bs(s, m - 1, i, j);
  printf("%I64d\n", ans);
  scanf(" ");
}
