#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1, 0, 0};
int dy[] = {0, 1, 0, -1, 0};
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<string> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  long long odp = 0;
  vector<vector<long long> > pref(m, vector<long long>(n, 0));
  for (int j = 0; j < m; ++j) {
    for (int i = 0; i < n; ++i) {
      bool ok = true;
      for (int l = 0; l < 5; ++l) {
        int x = i + dx[l];
        int y = j + dy[l];
        if (!(x >= 0 && x < n && y >= 0 && y < m && a[x][y] == '1')) ok = false;
      }
      if (ok) ++pref[j][i];
      if (i != 0) pref[j][i] += pref[j][i - 1];
    }
  }
  for (long long g = 1; g < n - 1; ++g) {
    for (long long d = g; d < n - 1; ++d) {
      long long s = 0;
      for (long long l = 1, p = 0; l < m - 1; ++l) {
        while (p < m - 2 && s < k) {
          ++p;
          s += pref[p][d] - pref[p][g - 1];
        }
        if (s >= k) odp += m - (p + 1);
        s -= pref[l][d] - pref[l][g - 1];
      }
    }
  }
  cout << odp;
  return 0;
}
