#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T gi() {
  T f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
const int INF = 0x3f3f3f3f, N = 2503, M = N << 1;
int n, m, k, s[N][N];
char t[N][N];
int up[2][N];
long long ans;
inline int sum(int x, int y, int xx, int yy) {
  return s[xx][yy] - s[x][yy] - s[xx][y] + s[x][y];
}
void solve(int x, int y, int xx, int yy, bool fl) {
  if (x == xx || y == yy) return;
  if (x + 1 == xx && y + 1 == yy) {
    ans += (sum(x, y, xx, yy) == k);
    return;
  }
  if (fl) {
    int mid = (x + xx) >> 1;
    solve(x, y, mid, yy, fl ^ 1);
    solve(mid, y, xx, yy, fl ^ 1);
    for (int i = y; i < yy; i += 1) {
      up[0][0] = up[1][0] = mid;
      for (int j = 1; j <= k + 1; j += 1) up[0][j] = x, up[1][j] = xx;
      for (int j = i + 1; j <= yy; j += 1) {
        for (int K = 1; K <= k + 1; K += 1) {
          while (sum(up[0][K], i, mid, j) >= K) ++up[0][K];
          while (sum(mid, i, up[1][K], j) >= K) --up[1][K];
        }
        for (int K = 0; K <= k; K += 1)
          ans += 1ll * (up[0][K] - up[0][K + 1]) *
                 (up[1][k - K + 1] - up[1][k - K]);
      }
    }
  } else {
    int mid = (y + yy) >> 1;
    solve(x, y, xx, mid, fl ^ 1);
    solve(x, mid, xx, yy, fl ^ 1);
    for (int i = x; i < xx; i += 1) {
      up[0][0] = up[1][0] = mid;
      for (int j = 1; j <= k + 1; j += 1) up[0][j] = y, up[1][j] = yy;
      for (int j = i + 1; j <= xx; j += 1) {
        for (int K = 1; K <= k + 1; K += 1) {
          while (sum(i, up[0][K], j, mid) >= K) ++up[0][K];
          while (sum(i, mid, j, up[1][K]) >= K) --up[1][K];
        }
        for (int K = 0; K <= k; K += 1)
          ans += 1ll * (up[0][K] - up[0][K + 1]) *
                 (up[1][k - K + 1] - up[1][k - K]);
      }
    }
  }
}
int main() {
  n = gi<int>(), m = gi<int>(), k = gi<int>();
  for (int i = 1; i <= n; i += 1) scanf("%s", t[i] + 1);
  for (int i = 1; i <= n; i += 1)
    for (int j = 1; j <= m; j += 1)
      s[i][j] = s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1] + (t[i][j] - '0');
  solve(0, 0, n, m, false);
  cout << ans << endl;
  return 0;
}
