#include <bits/stdc++.h>
using namespace std;
const int maxn = 2533;
char str[maxn];
int n, m, K;
int s[2][maxn][maxn];
int U[7], D[7];
long long ans;
int sum(const int &xl, const int &xr, const int &yl, const int &yr,
        const int &d) {
  return s[d][xr][yr] - s[d][xl - 1][yr] - s[d][xr][yl - 1] +
         s[d][xl - 1][yl - 1];
}
void init() {
  scanf("%d%d%d\n", &n, &m, &K);
  for (int i = 1; i <= n; i++) {
    scanf("%s", str + 1);
    for (int j = 1; j <= m; j++)
      s[0][i][j] += s[0][i - 1][j] + s[0][i][j - 1] - s[0][i - 1][j - 1] +
                    (str[j] == '1'),
          s[1][j][i] += s[1][j - 1][i] + s[1][j][i - 1] - s[1][j - 1][i - 1] +
                        (str[j] == '1');
  }
}
void work(int xl, int xr, int yl, int yr, int d) {
  if (xr - xl > yr - yl) swap(xl, yl), swap(xr, yr), d ^= 1;
  if (yl == yr) {
    ans += sum(xl, xr, yl, yr, d) == K;
    return;
  }
  int mid = yl + yr >> 1;
  for (int l = xl; l <= xr; l++) {
    for (int t = 0; t <= K; t++) D[t] = yl, U[t] = yr;
    for (int r = l; r <= xr; r++) {
      for (int t = 0; t <= K; t++) {
        for (; sum(l, r, mid + 1, U[t], d) > t; U[t]--)
          ;
        for (; sum(l, r, D[t], mid, d) > t; D[t]++)
          ;
      }
      for (int t = 0; t <= K; t++)
        ans += (U[t] - (t ? U[t - 1] : mid)) *
               ((t < K ? D[K - t - 1] : mid + 1) - D[K - t]);
    }
  }
  work(xl, xr, yl, mid, d);
  work(xl, xr, mid + 1, yr, d);
}
int main() {
  init();
  work(1, n, 1, m, 0);
  printf("%I64d\n", ans);
  return 0;
}
