#include <bits/stdc++.h>
long long gi() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) f ^= ch == '-', ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f ? x : -x;
}
std::mt19937 rnd(time(NULL));
template <class T>
void cxk(T& a, T b) {
  a = a > b ? a : b;
}
template <class T>
void cnk(T& a, T b) {
  a = a < b ? a : b;
}
char _[2510][2510];
int S[2510][2510], rS[2510][2510];
int n, m, K;
long long ans;
int get(int S[2510][2510], int x1, int x2, int ye, int y2) {
  return S[x2][y2] - S[x1 - 1][y2] - S[x2][ye - 1] + S[x1 - 1][ye - 1];
}
void divide(int l, int r, int L, int R) {
  if (l > r || L > R) return;
  auto A = (r - l < R - L ? rS : S);
  bool f = 0;
  if (r - l < R - L) f = 1, std::swap(l, L), std::swap(r, R);
  int mid = l + r >> 1;
  int Up[K + 1], Dn[K + 1];
  for (int p = L; p <= R; ++p) {
    for (int j = 0; j <= K; ++j) Up[j] = l - 1, Dn[j] = r + 1;
    for (int q = p; q <= R; ++q) {
      for (int j = 0; j <= K; ++j) {
        while (get(A, Up[j] + 1, mid, p, q) > j) ++Up[j];
        while (get(A, mid + 1, Dn[j] - 1, p, q) > j) --Dn[j];
      }
      static int aa[11], bb[11];
      aa[0] = mid - Up[0];
      bb[0] = Dn[0] - mid - 1;
      if (l == r) bb[0] = 1;
      for (int i = 1; i <= K; ++i)
        aa[i] = Up[i - 1] - Up[i], bb[i] = Dn[i] - Dn[i - 1];
      for (int i = 0; i <= K; ++i) ans += aa[i] * bb[K - i];
    }
  }
  if (f) std::swap(l, L), std::swap(r, R);
  if (f) {
    if (L == R) return;
    divide(l, r, L, mid), divide(l, r, mid + 1, R);
  } else {
    if (l == r) return;
    divide(l, mid, L, R), divide(mid + 1, r, L, R);
  }
}
int main() {
  n = gi(), m = gi(), K = gi();
  for (int i = 1; i <= n; ++i) scanf("%s", _[i] + 1);
  for (int i = 1; i <= m; ++i)
    for (int j = 1; j <= n; ++j) rS[i][j] = S[j][i] = _[j][i];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      S[i][j] += -'0' + S[i - 1][j] + S[i][j - 1] - S[i - 1][j - 1];
  for (int i = 1; i <= m; ++i)
    for (int j = 1; j <= n; ++j)
      rS[i][j] += -'0' + rS[i - 1][j] + rS[i][j - 1] - rS[i - 1][j - 1];
  divide(1, n, 1, m);
  printf("%lld\n", ans);
  return 0;
}
