#include <bits/stdc++.h>
template <class T>
void read(T &x) {
  int f = 1;
  char c = getchar();
  x = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  x *= f;
}
template <class T>
void write(T x) {
  int len = 0;
  char s[30];
  if (x < 0) putchar('-'), x = -x;
  do {
    s[++len] = x % 10;
    x /= 10;
  } while (x);
  while (len) putchar(s[len--] + '0');
}
template <class T>
inline bool gmin(T &a, T b) {
  return a > b ? a = b, true : false;
}
template <class T>
inline bool gmax(T &a, T b) {
  return a < b ? a = b, true : false;
}
const int maxn = 3e3 + 5;
int N, M, K;
int up[maxn], down[maxn];
int s[maxn][maxn];
long long ans;
char c[maxn];
int sum(int x1, int x2, int y1, int y2) {
  return s[x2][y2] - s[x1][y2] - s[x2][y1] + s[x1][y1];
}
void divide(int x1, int x2, int y1, int y2, bool cur) {
  if (x1 == x2 || y1 == y2) return;
  if (x2 == x1 + 1 && y2 == y1 + 1) {
    ans += sum(x1, x2, y1, y2) == K;
    return;
  }
  if (cur) {
    int mid = (x1 + x2) >> 1;
    divide(x1, mid, y1, y2, cur ^ 1);
    divide(mid, x2, y1, y2, cur ^ 1);
    for (int i = y1; i < y2; i++) {
      up[0] = mid;
      down[0] = mid;
      for (int p = 1; p <= K + 1; p++) up[p] = x1, down[p] = x2;
      for (int j = i + 1; j <= y2; j++) {
        for (int p = 1; p <= K + 1; p++)
          while (sum(up[p], mid, i, j) >= p) up[p]++;
        for (int p = 1; p <= K + 1; p++)
          while (sum(mid, down[p], i, j) >= p) down[p]--;
        for (int p = 0; p <= K; p++)
          ans += (up[p] - up[p + 1]) * (down[K - p + 1] - down[K - p]);
      }
    }
  } else {
    int mid = (y1 + y2) >> 1;
    divide(x1, x2, y1, mid, cur ^ 1);
    divide(x1, x2, mid, y2, cur ^ 1);
    for (int i = x1; i < x2; i++) {
      up[0] = mid;
      down[0] = mid;
      for (int p = 1; p <= K + 1; p++) up[p] = y1, down[p] = y2;
      for (int j = i + 1; j <= x2; j++) {
        for (int p = 1; p <= K + 1; p++)
          while (sum(i, j, up[p], mid) >= p) up[p]++;
        for (int p = 1; p <= K + 1; p++)
          while (sum(i, j, mid, down[p]) >= p) down[p]--;
        for (int p = 0; p <= K; p++)
          ans += (up[p] - up[p + 1]) * (down[K - p + 1] - down[K - p]);
      }
    }
  }
}
int main() {
  scanf("%d%d%d", &N, &M, &K);
  for (int i = 1; i <= N; i++) {
    scanf("%s", c);
    for (int j = 1; j <= M; j++)
      s[i][j] = s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1] + c[j - 1] - '0';
  }
  divide(0, N, 0, M, 0);
  write(ans);
  putchar('\n');
  return 0;
}
