#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int sum[2505][2505], f[2][10];
char s[2505];
long long ans;
int get(int l1, int r1, int l2, int r2) {
  return sum[l2][r2] - sum[l2][r1] - sum[l1][r2] + sum[l1][r1];
}
void solve(int l1, int r1, int l2, int r2, int flg) {
  if (l1 == l2 || r1 == r2) return;
  if (l1 + 1 == l2 && r1 + 1 == r2) {
    ans += (get(l1, r1, l2, r2) == k);
    return;
  }
  if (!flg) {
    int mid = (l1 + l2) >> 1, i, j, l;
    solve(l1, r1, mid, r2, flg ^ 1);
    solve(mid, r1, l2, r2, flg ^ 1);
    for (i = r1; i < r2; i++) {
      f[0][0] = f[1][0] = mid;
      for (l = 1; l <= k + 1; l++) f[0][l] = l1, f[1][l] = l2;
      for (j = i + 1; j <= r2; j++) {
        for (l = 1; l <= k + 1; l++) {
          while (get(f[0][l], i, mid, j) >= l) f[0][l]++;
          while (get(mid, i, f[1][l], j) >= l) f[1][l]--;
        }
        for (l = 0; l <= k; l++)
          ans +=
              1ll * (f[0][l] - f[0][l + 1]) * (f[1][k - l + 1] - f[1][k - l]);
      }
    }
  } else {
    int mid = (r1 + r2) >> 1, i, j, l;
    solve(l1, r1, l2, mid, flg ^ 1);
    solve(l1, mid, l2, r2, flg ^ 1);
    for (i = l1; i < l2; i++) {
      f[0][0] = f[1][0] = mid;
      for (l = 1; l <= k + 1; l++) f[0][l] = r1, f[1][l] = r2;
      for (j = i + 1; j <= l2; j++) {
        for (l = 1; l <= k + 1; l++) {
          while (get(i, f[0][l], j, mid) >= l) f[0][l]++;
          while (get(i, mid, j, f[1][l]) >= l) f[1][l]--;
        }
        for (l = 0; l <= k; l++)
          ans +=
              1ll * (f[0][l] - f[0][l + 1]) * (f[1][k - l + 1] - f[1][k - l]);
      }
    }
  }
}
int main() {
  int i, j;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    for (j = 1; j <= m; j++)
      sum[i][j] = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1] + s[j] - 48;
  }
  solve(0, 0, n, m, 0);
  printf("%I64d", ans);
}
