#include <bits/stdc++.h>
using namespace std;
char c[2502];
int n, m, t, i, j, a[2502][2502], sum[2502][2502], L[2502], R[2502];
long long ans;
int cal(int x1, int y1, int x2, int y2) {
  return sum[x2][y2] - sum[x2][y1] - sum[x1][y2] + sum[x1][y1];
}
void solve(int x1, int x2, int y1, int y2, int op) {
  if (x1 == x2 || y1 == y2) return;
  if (x1 == x2 - 1 && y1 == y2 - 1) {
    ans += (cal(x1, y1, x2, y2) == t);
    return;
  }
  if (op) {
    int mid = (x1 + x2) / 2;
    solve(x1, mid, y1, y2, 0);
    solve(mid, x2, y1, y2, 0);
    for (int i = y1; i <= y2; i++) {
      L[0] = R[0] = mid;
      for (int k = 1; k <= t + 1; k++) L[k] = x1, R[k] = x2;
      for (int j = i + 1; j <= y2; j++) {
        for (int k = 1; k <= t + 1; k++) {
          while (cal(L[k], i, mid, j) >= k) L[k]++;
          while (cal(mid, i, R[k], j) >= k) R[k]--;
        }
        for (int k = 0; k <= t; k++)
          ans += 1LL * (L[k] - L[k + 1]) * (R[t - k + 1] - R[t - k]);
      }
    }
  } else {
    int mid = (y1 + y2) / 2;
    solve(x1, x2, y1, mid, 1);
    solve(x1, x2, mid, y2, 1);
    for (int i = x1; i <= x2; i++) {
      L[0] = R[0] = mid;
      for (int k = 1; k <= t + 1; k++) L[k] = y1, R[k] = y2;
      for (int j = i + 1; j <= x2; j++) {
        for (int k = 1; k <= t + 1; k++) {
          while (cal(i, L[k], j, mid) >= k) L[k]++;
          while (cal(i, mid, j, R[k]) >= k) R[k]--;
        }
        for (int k = 0; k <= t; k++)
          ans += 1LL * (L[k] - L[k + 1]) * (R[t - k + 1] - R[t - k]);
      }
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &t);
  for (i = 1; i <= n; i++) {
    scanf("%s", c + 1);
    for (j = 1; j <= m; j++) a[i][j] = (int)(c[j] - '0');
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++)
      sum[i][j] = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1] + a[i][j];
  }
  solve(0, n, 0, m, 0);
  cout << ans << endl;
  return 0;
}
