#include <bits/stdc++.h>
using namespace std;
const int maxn = 2579;
int n, m, k;
vector<string> s(maxn);
vector<vector<int> > pf(maxn, vector<int>(maxn, 0));
inline int sum(int x1, int x2, int y1, int y2, bool fl) {
  if (fl) swap(x1, y1), swap(x2, y2);
  return pf[x2][y2] - pf[x2][y1] - pf[x1][y2] + pf[x1][y1];
}
long long divide_and_conquer(int x1, int x2, int y1, int y2, bool fl) {
  if (x1 == x2 && y1 == y2) return sum(x1, x1 + 1, y1, y1 + 1, fl) == k;
  if (x1 > x2 || y1 > y2) return 0;
  int n = x2 - x1 + 1, m = y2 - y1 + 1;
  if (n < m) {
    fl ^= 1;
    swap(n, m), swap(x1, y1), swap(x2, y2);
  }
  int mid = n / 2;
  long long ans = divide_and_conquer(x1, x1 + mid - 1, y1, y2, fl) +
                  divide_and_conquer(x1 + mid, x2, y1, y2, fl);
  for (int l = 0; l < m; l++) {
    vector<int> up(k + 2, 0), dw(k + 2, n);
    up[0] = mid, dw[0] = mid;
    for (int r = l; r < m; r++) {
      for (int i = 1; i < k + 2; i++) {
        while (sum(x1 + up[i], x1 + mid, y1 + l, y1 + r + 1, fl) >= i) up[i]++;
        while (sum(x1 + mid, x1 + dw[i], y1 + l, y1 + r + 1, fl) >= i) dw[i]--;
      }
      for (int i = 0; i <= k; i++) {
        ans += (up[i] - up[i + 1]) * (dw[k - i + 1] - dw[k - i]);
      }
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    for (int j = 0; j < m; j++)
      pf[i + 1][j + 1] =
          pf[i + 1][j] + pf[i][j + 1] - pf[i][j] + (s[i][j] == '1');
  }
  cout << divide_and_conquer(0, n - 1, 0, m - 1, false) << "\n";
  return 0;
}
