#include <bits/stdc++.h>
using namespace std;
int n, m, K, Up[2][10], pre[2505][2505];
long long Ans;
char ch[2505][2505];
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline int cal(int x1, int x2, int y1, int y2) {
  return pre[x2][y2] - pre[x2][y1] - pre[x1][y2] + pre[x1][y1];
}
void solve(int x1, int x2, int y1, int y2, int type) {
  if (x1 == x2 || y1 == y2) return;
  if ((x1 == x2 - 1) && (y1 == y2 - 1)) {
    Ans += (cal(x1, x2, y1, y2) == K);
    return;
  }
  if (type) {
    int mid = (x1 + x2) >> 1;
    solve(x1, mid, y1, y2, 0);
    solve(mid, x2, y1, y2, 0);
    for (int i = y1; i <= y2; ++i) {
      Up[0][0] = Up[1][0] = mid;
      for (int k = 1; k <= K + 1; ++k) Up[0][k] = x1, Up[1][k] = x2;
      for (int j = i + 1; j <= y2; ++j) {
        for (int k = 1; k <= K + 1; ++k)
          while (cal(Up[0][k], mid, i, j) >= k) ++Up[0][k];
        for (int k = 1; k <= K + 1; ++k)
          while (cal(mid, Up[1][k], i, j) >= k) --Up[1][k];
        for (int k = 0; k <= K; ++k)
          Ans += 1LL * (Up[0][k] - Up[0][k + 1]) *
                 (Up[1][K - k + 1] - Up[1][K - k]);
      }
    }
  } else {
    int mid = (y1 + y2) >> 1;
    solve(x1, x2, y1, mid, 1);
    solve(x1, x2, mid, y2, 1);
    for (int i = x1; i <= x2; ++i) {
      Up[0][0] = Up[1][0] = mid;
      for (int k = 1; k <= K + 1; ++k) Up[0][k] = y1, Up[1][k] = y2;
      for (int j = i + 1; j <= x2; ++j) {
        for (int k = 1; k <= K + 1; ++k)
          while (cal(i, j, Up[0][k], mid) >= k) ++Up[0][k];
        for (int k = 1; k <= K + 1; ++k)
          while (cal(i, j, mid, Up[1][k]) >= k) --Up[1][k];
        for (int k = 0; k <= K; ++k)
          Ans += 1LL * (Up[0][k] - Up[0][k + 1]) *
                 (Up[1][K - k + 1] - Up[1][K - k]);
      }
    }
  }
}
int main() {
  n = read();
  m = read();
  K = read();
  for (int i = 1; i <= n; ++i) scanf("%s", ch[i] + 1);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      pre[i][j] =
          pre[i - 1][j] + pre[i][j - 1] - pre[i - 1][j - 1] + ch[i][j] - '0';
  solve(0, n, 0, m, 0);
  printf("%I64d\n", Ans);
  return 0;
}
