#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
char s[2555][2555];
int n, m, k;
int sum[2][2555][2555];
inline int calc(int x1, int y1, int x2, int y2, int fl) {
  return sum[fl][x2][y2] - sum[fl][x1 - 1][y2] - sum[fl][x2][y1 - 1] +
         sum[fl][x1 - 1][y1 - 1];
}
int top[10], bot[10];
long long solve(int x1, int y1, int x2, int y2, int fl) {
  if (x2 - x1 < y2 - y1) {
    swap(x1, y1);
    swap(x2, y2);
    fl ^= 1;
  }
  if (x1 == x2) {
    return (calc(x1, y1, x2, y2, fl) == k);
  }
  long long ans = 0;
  int mid = x1 + x2 >> 1;
  for (int st = y1; st <= y2; st++) {
    for (int i = 0; i <= k + 1; i++) top[i] = x1, bot[i] = x2;
    for (int ed = st; ed <= y2; ed++) {
      for (int i = k; i >= 0; i--) {
        smax(top[i], top[i + 1]);
        smin(bot[i], bot[i + 1]);
        while (calc(top[i], st, mid, ed, fl) > i) top[i]++;
        while (calc(mid + 1, st, bot[i], ed, fl) > i) bot[i]--;
      }
      for (int i = 0; i <= k; i++) {
        ans += ((i ? top[i - 1] : mid + 1) - top[i]) *
               (bot[k - i] - (k - i ? bot[k - i - 1] : mid));
      }
    }
  }
  return ans + solve(x1, y1, mid, y2, fl) + solve(mid + 1, y1, x2, y2, fl);
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    scanf(" ");
    gets(s[i] + 1);
    for (int j = 1; j <= m; j++) {
      sum[0][i][j] = s[i][j] - '0' + sum[0][i - 1][j] + sum[0][i][j - 1] -
                     sum[0][i - 1][j - 1];
      sum[1][j][i] = s[i][j] - '0' + sum[1][j - 1][i] + sum[1][j][i - 1] -
                     sum[1][j - 1][i - 1];
    }
  }
  cout << solve(1, 1, n, m, 0) << endl;
  return 0;
}
