#include <bits/stdc++.h>
using namespace std;
int sum[3333][3333];
char s[3333];
int sleft[11], sright[11];
using ll = long long;
ll res;
int n, m, k;
int getsum(int lx, int rx, int ly, int ry) {
  return sum[rx][ry] - sum[rx][ly - 1] - sum[lx - 1][ry] + sum[lx - 1][ly - 1];
}
void divide(int lx, int rx, int ly, int ry, bool type) {
  if (lx > rx || ly > ry) return;
  if (type) {
    int mid = (ly + ry) / 2;
    for (int l = lx; l < rx + 1; l++) {
      for (int i = 1; i < k + 2; i++) sleft[i] = ly, sright[i] = ry;
      sleft[0] = mid + 1, sright[0] = mid;
      for (int r = l; r < rx + 1; r++) {
        for (int i = 0; i < k + 1; i++)
          while (sleft[i + 1] <= mid && getsum(l, r, sleft[i + 1], mid) > i)
            sleft[i + 1]++;
        for (int i = 0; i < k + 1; i++)
          while (sright[i + 1] > mid &&
                 getsum(l, r, mid + 1, sright[i + 1]) > i)
            sright[i + 1]--;
        for (int i = 0; i < k + 1; i++)
          res +=
              (sright[i + 1] - sright[i]) * (sleft[k - i] - sleft[k - i + 1]);
        res += (sleft[k] - sleft[k + 1]) + (sright[k + 1] - sright[k]);
      }
    }
    divide(lx, rx, ly, mid - 1, !type);
    divide(lx, rx, mid + 2, ry, !type);
  } else {
    int mid = (lx + rx) / 2;
    for (int l = ly; l < ry + 1; l++) {
      for (int i = 0; i < k + 2; i++) sleft[i] = lx, sright[i] = rx;
      sleft[0] = mid + 1, sright[0] = mid;
      for (int r = l; r < ry + 1; r++) {
        for (int i = 0; i < k + 1; i++)
          while (sleft[i + 1] <= mid && getsum(sleft[i + 1], mid, l, r) > i)
            sleft[i + 1]++;
        for (int i = 0; i < k + 1; i++)
          while (sright[i + 1] > mid &&
                 getsum(mid + 1, sright[i + 1], l, r) > i)
            sright[i + 1]--;
        for (int i = 0; i < k + 1; i++)
          res +=
              (sright[i + 1] - sright[i]) * (sleft[k - i] - sleft[k - i + 1]);
        res += (sleft[k] - sleft[k + 1]) + (sright[k + 1] - sright[k]);
      }
    }
    divide(lx, mid - 1, ly, ry, !type);
    divide(mid + 2, rx, ly, ry, !type);
  }
}
int main(void) {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i < n + 1; i++) {
    scanf("%s", s);
    for (int j = 1; j < m + 1; j++) sum[i][j] = s[j - 1] - '0';
  }
  for (int i = 1; i < n + 1; i++)
    for (int j = 1; j < m + 1; j++)
      sum[i][j] += sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1];
  divide(1, n, 1, m, 1);
  printf("%I64d\n", res);
}
