#include <bits/stdc++.h>
using namespace std;
const int N = 2505;
int n, m, K, a[2][N][N], L[N][8], R[N][8], Lc[N][8], Rc[N][8];
char s[N];
long long ans;
void work(int x1, int x2, int y1, int y2, int d) {
  if (y2 - y1 > x2 - x1) {
    swap(x1, y1), swap(x2, y2), d ^= 1;
  }
  if (x1 + 1 == x2) {
    ans += a[d][y1][x2] - a[d][y1][x1] == K;
    return;
  }
  int mid = x1 + x2 >> 1;
  work(x1, mid, y1, y2, d), work(mid, x2, y1, y2, d);
  for (int i = y1; i < y2; ++i) {
    for (int k = 0; k < K + 1; ++k)
      L[i][k] = x1, Lc[i][k] = 0, R[i][k] = x2, Rc[i][k] = 0;
    for (int j = y1; j < i + 1; ++j) {
      for (int k = 0; k < K + 1; ++k) {
        Lc[j][k] += a[d][i][mid] - a[d][i][L[j][k]];
        while (Lc[j][k] > k)
          Lc[j][k] -= a[d ^ 1][L[j][k]][i + 1] - a[d ^ 1][L[j][k]][j],
              ++L[j][k];
        Rc[j][k] += a[d][i][R[j][k]] - a[d][i][mid];
        while (Rc[j][k] > k)
          --R[j][k],
              Rc[j][k] -= a[d ^ 1][R[j][k]][i + 1] - a[d ^ 1][R[j][k]][j];
      }
      for (int k = 0; k < K + 1; ++k)
        ans += ((k ? L[j][k - 1] : mid) - L[j][k]) *
               (R[j][K - k] - (K - k ? R[j][K - k - 1] : mid));
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &K);
  for (int i = 0; i < n; ++i) {
    scanf("%s", s);
    for (int j = 0; j < m; ++j) a[0][i][j + 1] = a[1][j][i + 1] = s[j] - 48;
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) a[0][i][j + 1] += a[0][i][j];
  for (int j = 0; j < m; ++j)
    for (int i = 0; i < n; ++i) a[1][j][i + 1] += a[1][j][i];
  work(0, n, 0, m, 1);
  printf("%I64d\n", ans);
  return 0;
}
