#include <bits/stdc++.h>
using namespace std;
int read() {
  int X = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') X = X * 10 + c - '0', c = getchar();
  return X * w;
}
const int N = 2500 + 10, M = 8;
int n, m, k, s[N][N];
char a[N][N];
long long ans = 0;
int sum(int lx, int rx, int ly, int ry) {
  return s[rx][ry] - s[lx - 1][ry] - s[rx][ly - 1] + s[lx - 1][ly - 1];
}
int pl[M], pr[M];
void solve(int lx, int rx, int ly, int ry) {
  if (lx == rx && ly == ry) {
    if (sum(lx, rx, ly, ry) == k) ++ans;
    return;
  }
  if (rx - lx >= ry - ly) {
    int mid = (lx + rx) >> 1;
    solve(lx, mid, ly, ry), solve(mid + 1, rx, ly, ry);
    for (int l = ly; l <= ry; ++l) {
      for (int i = 0; i <= k; ++i) pl[i] = lx, pr[i] = rx;
      for (int r = l; r <= ry; ++r) {
        for (int i = 0; i <= k; ++i) {
          while (pl[i] <= mid && sum(pl[i], mid, l, r) > i) ++pl[i];
          while (pr[i] > mid && sum(mid + 1, pr[i], l, r) > i) --pr[i];
        }
        for (int i = 0; i <= k; ++i)
          ans += (i == 0 ? mid + 1 - pl[i] : pl[i - 1] - pl[i]) *
                 (i == k ? pr[k - i] - mid : pr[k - i] - pr[k - i - 1]);
      }
    }
  } else {
    int mid = (ly + ry) >> 1;
    solve(lx, rx, ly, mid), solve(lx, rx, mid + 1, ry);
    for (int l = lx; l <= rx; ++l) {
      for (int i = 0; i <= k; ++i) pl[i] = ly, pr[i] = ry;
      for (int r = l; r <= rx; ++r) {
        for (int i = 0; i <= k; ++i) {
          while (pl[i] <= mid && sum(l, r, pl[i], mid) > i) ++pl[i];
          while (pr[i] > mid && sum(l, r, mid + 1, pr[i]) > i) --pr[i];
        }
        for (int i = 0; i <= k; ++i)
          ans += (i == 0 ? mid + 1 - pl[i] : pl[i - 1] - pl[i]) *
                 (i == k ? pr[k - i] - mid : pr[k - i] - pr[k - i - 1]);
      }
    }
  }
}
int main() {
  n = read(), m = read(), k = read();
  for (int i = 1; i <= n; ++i) scanf("%s", a[i] + 1);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      s[i][j] = s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1] + a[i][j] - '0';
  solve(1, n, 1, m);
  printf("%lld\n", ans);
  return 0;
}
