#include <bits/stdc++.h>
using namespace std;
const int MX = 100 * 5 + 10;
int s[MX][MX], n, m, k;
long long ans;
bool a[MX][MX];
int getstar(int u, int d, int l, int r) {
  return s[d - 1][r - 1] + s[u][l] - s[d - 1][l] - s[u][r - 1];
}
char c;
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> c;
      if (c == '1') a[i][j] = true;
    }
  for (int i = 1; i < n - 1; i++)
    for (int j = 1; j < m - 1; j++) {
      s[i][j] -= s[i - 1][j - 1];
      s[i][j] += s[i][j - 1];
      s[i][j] += s[i - 1][j];
      s[i][j] += (int)(a[i][j] & a[i - 1][j] & a[i][j - 1] & a[i + 1][j] &
                       a[i][j + 1]);
    }
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int r = 0;
      for (int l = 0; l < m; l++) {
        while (r < m && getstar(i, j, l, r) < k) r++;
        if (r == m)
          break;
        else
          ans += m - r;
      }
    }
  cout << ans << endl;
  return 0;
}
