#include <bits/stdc++.h>
using namespace std;
int cond = 1;
const int N = 513;
char s[N][N];
int w[N];
int main() {
  int n, m, k;
  long long ret = 0;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < (n); i++) scanf("%s", s[i]);
  for (int j1 = 0; j1 < (m); j1++) {
    for (int i = 0; i < (n); i++) w[i] = 0;
    for (typeof(j1 + 3) j2 = (j1 + 3); j2 <= (m); ++j2) {
      for (typeof(1) i = (1); i <= (n - 2); ++i)
        if (s[i][j2 - 2] == '1' && s[i - 1][j2 - 2] == '1' &&
            s[i + 1][j2 - 2] == '1' && s[i][j2 - 2 - 1] == '1' &&
            s[i][j2 - 2 + 1] == '1')
          w[i]++;
      int i1 = 0, i2 = 2, ss = 0;
      while (1) {
        while (i2 <= n && ss < k) {
          ss += w[i2 - 1];
          i2++;
        }
        if (i2 > n) break;
        ret += n - i2 + 1;
        ss -= w[i1 + 1];
        i1++;
      }
    }
  }
  cout << ret << "\n";
  return 0;
}
