#include <bits/stdc++.h>
using namespace std;
const int SIZE = 2555;
int N, M, K, dd[SIZE][SIZE];
char s[SIZE][SIZE];
int get(int x1, int y1, int x2, int y2) {
  x1--;
  y1--;
  return dd[x2][y2] - dd[x2][y1] - dd[x1][y2] + dd[x1][y1];
}
long long an;
void divide(int x1, int y1, int x2, int y2, int ty) {
  if (ty == 0) {
    if (x1 == x2) {
      for (int i = y1; i <= y2; i++) {
        int cnt = 0;
        for (int j = i; j <= y2 && cnt <= K; j++) {
          cnt += s[x1][j];
          if (cnt == K) an++;
        }
      }
      return;
    }
    int mm = (x1 + x2) >> 1;
    for (int i = y1; i <= y2; i++) {
      int cnt[2][7] = {};
      for (int j = 0; j <= K; j++) {
        cnt[0][j] = mm - x1 + 1;
        cnt[1][j] = x2 - mm;
      }
      for (int j = i; j <= y2; j++) {
        for (int k = 0; k <= K; k++)
          while (cnt[0][k] > 0 && get(mm - cnt[0][k] + 1, i, mm, j) > k)
            cnt[0][k]--;
        for (int k = 0; k <= K; k++)
          while (cnt[1][k] > 0 && get(mm + 1, i, mm + cnt[1][k], j) > k)
            cnt[1][k]--;
        for (int k = 0; k <= K; k++) {
          an += (cnt[0][k] - (k ? cnt[0][k - 1] : 0)) *
                (cnt[1][K - k] - (K - k ? cnt[1][K - k - 1] : 0));
        }
      }
    }
    divide(x1, y1, mm, y2, ty ^ 1);
    divide(mm + 1, y1, x2, y2, ty ^ 1);
  } else {
    if (y1 == y2) {
      for (int i = x1; i <= x2; i++) {
        int cnt = 0;
        for (int j = i; j <= x2 && cnt <= K; j++) {
          cnt += s[j][y1];
          if (cnt == K) an++;
        }
      }
      return;
    }
    int mm = (y1 + y2) >> 1;
    for (int i = x1; i <= x2; i++) {
      int cnt[2][7] = {};
      for (int j = 0; j <= K; j++) {
        cnt[0][j] = mm - y1 + 1;
        cnt[1][j] = y2 - mm;
      }
      for (int j = i; j <= x2; j++) {
        for (int k = 0; k <= K; k++)
          while (cnt[0][k] > 0 && get(i, mm - cnt[0][k] + 1, j, mm) > k)
            cnt[0][k]--;
        for (int k = 0; k <= K; k++)
          while (cnt[1][k] > 0 && get(i, mm + 1, j, mm + cnt[1][k]) > k)
            cnt[1][k]--;
        for (int k = 0; k <= K; k++) {
          an += (cnt[0][k] - (k ? cnt[0][k - 1] : 0)) *
                (cnt[1][K - k] - (K - k ? cnt[1][K - k - 1] : 0));
        }
      }
    }
    divide(x1, y1, x2, mm, ty ^ 1);
    divide(x1, mm + 1, x2, y2, ty ^ 1);
  }
}
int main() {
  scanf("%d%d%d", &(N), &(M), &(K));
  for (int i = 1; i <= N; i++) {
    scanf("%s", (s[i] + 1));
    for (int j = 1; j <= M; j++) {
      s[i][j] -= '0';
      dd[i][j] = dd[i][j - 1] + s[i][j];
    }
    for (int j = 1; j <= M; j++) dd[i][j] += dd[i - 1][j];
  }
  divide(1, 1, N, M, 0);
  cout << an << endl;
  return 0;
}
