#include <bits/stdc++.h>
inline int read() {
  int data = 0, w = 1;
  char ch = getchar();
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') w = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') data = data * 10 + (ch ^ 48), ch = getchar();
  return data * w;
}
const int N(2505);
int n, m, K, a[N][N], up[10], dn[10];
char s[N];
long long ans;
inline int Sum(int x1, int y1, int x2, int y2) {
  return a[x2][y2] - a[x1 - 1][y2] - a[x2][y1 - 1] + a[x1 - 1][y1 - 1];
}
void Div(int x1, int x2, int y1, int y2) {
  if (x1 == x2 && y1 == y2) return (void)(ans += (Sum(x1, y1, x2, y2) == K));
  if (x2 - x1 > y2 - y1) {
    int mid = (x1 + x2) >> 1;
    Div(x1, mid, y1, y2), Div(mid + 1, x2, y1, y2);
    for (int l = y1; l <= y2; l++) {
      up[0] = mid, dn[0] = mid + 1;
      for (int i = 1; i <= K + 1; i++) up[i] = x2, dn[i] = x1;
      for (int r = l; r <= y2; r++) {
        for (int i = 1; i <= K + 1; i++) {
          while (up[i] > mid && Sum(mid + 1, l, up[i], r) >= i) --up[i];
          while (dn[i] <= mid && Sum(dn[i], l, mid, r) >= i) ++dn[i];
        }
        for (int i = 0; i <= K; i++)
          ans += 1ll * (up[i + 1] - up[i]) * (dn[K - i] - dn[K - i + 1]);
      }
    }
  } else {
    int mid = (y1 + y2) >> 1;
    Div(x1, x2, y1, mid), Div(x1, x2, mid + 1, y2);
    for (int l = x1; l <= x2; l++) {
      up[0] = mid, dn[0] = mid + 1;
      for (int i = 1; i <= K + 1; i++) up[i] = y2, dn[i] = y1;
      for (int r = l; r <= x2; r++) {
        for (int i = 1; i <= K + 1; i++) {
          while (up[i] > mid && Sum(l, mid + 1, r, up[i]) >= i) --up[i];
          while (dn[i] <= mid && Sum(l, dn[i], r, mid) >= i) ++dn[i];
        }
        for (int i = 0; i <= K; i++)
          ans += 1ll * (up[i + 1] - up[i]) * (dn[K - i] - dn[K - i + 1]);
      }
    }
  }
}
int main() {
  n = read(), m = read(), K = read();
  for (int i = 1; i <= n; i++)
    for (int j = (std::scanf("%s", s + 1), 1); j <= m; j++)
      a[i][j] = s[j] - '0';
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) a[i][j] += a[i - 1][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) a[i][j] += a[i][j - 1];
  Div(1, n, 1, m), std::cout << ans << std::endl;
  return 0;
}
