#include <bits/stdc++.h>
using namespace std;
int n, m, k, bl[2600][10], br[2600][10], cl[10], cr[10], tl[10], tr[10];
long long ans;
char a[2600][2600];
void work(int u, int d, int l, int r) {
  if (d - u > r - l) {
    int m(u + d >> 1);
    for (int i = l; i <= r; i++) {
      int t(0);
      bl[i][0] = m;
      for (int j = m; j >= u; j--) {
        if (a[j][i] == '1') bl[i][++t] = j;
        if (t == k + 1) break;
      }
      while (t < k + 1) bl[i][++t] = u - 1;
      t = 0;
      br[i][0] = m;
      for (int j = m + 1; j <= d; j++) {
        if (a[j][i] == '1') br[i][++t] = j;
        if (t == k + 1) break;
      }
      while (t < k + 1) br[i][++t] = d + 1;
    }
    for (int i = l; i <= r; i++) {
      cl[0] = cr[0] = m;
      for (int t = 1; t <= k + 1; t++) cl[t] = u - 1, cr[t] = d + 1;
      for (int j = i; j <= r; j++) {
        for (int t = 0; t <= k + 1; t++) tl[t] = cl[t], tr[t] = cr[t];
        int p(1), q(1);
        for (int t = 1; t <= k + 1; t++)
          if (tl[p] > bl[j][q])
            cl[t] = tl[p++];
          else
            cl[t] = bl[j][q++];
        p = 1, q = 1;
        for (int t = 1; t <= k + 1; t++)
          if (tr[p] < br[j][q])
            cr[t] = tr[p++];
          else
            cr[t] = br[j][q++];
        for (int t = 0; t <= k; t++)
          ans += (cl[t] - cl[t + 1]) * (cr[k - t + 1] - cr[k - t]);
      }
    }
    if (u < m) work(u, m - 1, l, r);
    if (m < d) work(m + 1, d, l, r);
  } else {
    int m(l + r >> 1);
    for (int i = u; i <= d; i++) {
      int t(0);
      bl[i][0] = m;
      for (int j = m; j >= l; j--) {
        if (a[i][j] == '1') bl[i][++t] = j;
        if (t == k + 1) break;
      }
      while (t < k + 1) bl[i][++t] = l - 1;
      t = 0;
      br[i][0] = m;
      for (int j = m + 1; j <= r; j++) {
        if (a[i][j] == '1') br[i][++t] = j;
        if (t == k + 1) break;
      }
      while (t < k + 1) br[i][++t] = r + 1;
    }
    for (int i = u; i <= d; i++) {
      cl[0] = cr[0] = m;
      for (int t = 1; t <= k + 1; t++) cl[t] = l - 1, cr[t] = r + 1;
      for (int j = i; j <= d; j++) {
        for (int t = 0; t <= k + 1; t++) tl[t] = cl[t], tr[t] = cr[t];
        int p(1), q(1);
        for (int t = 1; t <= k + 1; t++)
          if (tl[p] > bl[j][q])
            cl[t] = tl[p++];
          else
            cl[t] = bl[j][q++];
        p = 1, q = 1;
        for (int t = 1; t <= k + 1; t++)
          if (tr[p] < br[j][q])
            cr[t] = tr[p++];
          else
            cr[t] = br[j][q++];
        for (int t = 0; t <= k; t++)
          ans += (cl[t] - cl[t + 1]) * (cr[k - t + 1] - cr[k - t]);
      }
    }
    if (l < m) work(u, d, l, m - 1);
    if (m < r) work(u, d, m + 1, r);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  work(1, n, 1, m);
  printf("%I64d\n", ans);
  return 0;
}
