#include <bits/stdc++.h>
using namespace std;
int c[2][2510][2510];
int l[2][2510][2510], r[2][2510][2510];
int n, m, k;
int nn[2], mm[2];
char str[2510];
int bl[20], br[20];
int al[10], ar[10];
bool cmpl(int x, int y) { return x > y; }
long long f(int x0, int y0, int x1, int y1, int t) {
  if (y0 > y1) return 0;
  long long ans = 0;
  int i, j, y;
  if (y0 == y1) {
    y = 0;
    for (i = x0; i <= x1; i++) {
      y = 0;
      for (j = i; j <= x1; j++) {
        y += c[t][j][y0];
        if (y == k) ans++;
      }
    }
    return ans;
  }
  int mid = (y0 + y1) >> 1, ii, s;
  for (i = x0; i <= x1; i++) {
    for (j = 0; j <= k; j++) bl[j] = y0 - 1;
    for (j = 0; j <= k; j++) br[j] = y1 + 1;
    for (j = i; j <= x1; j++) {
      y = l[t][j][mid];
      for (ii = 0; ii <= k; ii++) {
        if (y < y0)
          bl[k + 1 + ii] = y0 - 1;
        else {
          bl[k + 1 + ii] = y;
          y = l[t][j][y - 1];
        }
      }
      y = r[t][j][mid + 1];
      for (ii = 0; ii <= k; ii++) {
        if (y > y1)
          br[k + 1 + ii] = y1 + 1;
        else {
          br[k + 1 + ii] = y;
          y = r[t][j][y + 1];
        }
      }
      sort(bl, bl + k + k + 2, cmpl);
      sort(br, br + k + k + 2);
      al[0] = mid - bl[0];
      s = al[0];
      for (ii = 1; ii <= k; ii++) {
        al[ii] = mid - bl[ii] - s;
        s += al[ii];
      }
      ar[0] = br[0] - 1 - mid;
      s = ar[0];
      for (ii = 1; ii <= k; ii++) {
        ar[ii] = br[ii] - 1 - mid - s;
        s += ar[ii];
      }
      ar[0]++;
      for (ii = 0; ii <= k; ii++) ans += al[ii] * ar[k - ii];
    }
  }
  return ans + f(y0, x0, mid - 1, x1, t ^ 1) + f(mid + 1, x0, y1, x1, t ^ 1);
}
int main() {
  int i, j;
  scanf("%d%d%d", &n, &m, &k);
  nn[0] = n, mm[0] = m;
  nn[1] = m, mm[1] = n;
  for (i = 1; i <= n; i++) {
    scanf("%s", str);
    for (j = 0; j < m; j++) c[0][i][j + 1] = str[j] - '0';
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) c[1][j][i] = c[0][i][j];
  for (int kk = 0; kk < 2; kk++) {
    for (i = 1; i <= nn[kk]; i++) {
      l[kk][i][0] = 0;
      for (j = 1; j <= mm[kk]; j++)
        l[kk][i][j] = c[kk][i][j] ? j : l[kk][i][j - 1];
    }
    for (i = 1; i <= nn[kk]; i++) {
      r[kk][i][mm[kk] + 1] = mm[kk] + 1;
      for (j = mm[kk]; j >= 1; j--)
        r[kk][i][j] = c[kk][i][j] ? j : r[kk][i][j + 1];
    }
  }
  printf("%I64d\n", f(1, 1, n, m, 0));
}
