#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T pow2(T a) {
  return a * a;
}
template <class T>
inline bool mineq(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const int maxn = (int)555;
;
int num[maxn][maxn], row[maxn][maxn], col[maxn][maxn], n, m, k,
    num2[maxn][maxn];
int calcrow(int r, int i, int j) { return max(0, row[r][j] - row[r][i - 1]); }
int calccol(int c, int i, int j) { return max(0, col[j][c] - col[i - 1][c]); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> k;
  for (int i = 1; i < n + 1; i++)
    for (int j = 1; j < m + 1; j++) {
      char c;
      cin >> c;
      num[i][j] = c - '0';
    }
  for (int i = 1; i < n + 1; i++)
    for (int j = 1; j < m + 1; j++) {
      num2[i][j] = (num[i][j] && num[i - 1][j] && num[i + 1][j] &&
                    num[i][j + 1] && num[i][j - 1]);
      row[i][j] = row[i][j - 1] + num2[i][j];
      col[i][j] = col[i - 1][j] + num2[i][j];
    }
  long long ans = 0;
  for (int i = 1; i < n + 1; i++)
    for (int j = i + 2; j < n + 1; j++) {
      int p = 0, p2 = 0, sum = 0;
      while (p < m && p2 < m) {
        if (sum < k) {
          p2++;
          sum += calccol(p2, i + 1, j - 1);
          continue;
        }
        if (sum >= k) {
          if (p > 1) ans += m - p2;
          sum -= calccol(p, i + 1, j - 1);
          p++;
          continue;
        }
      }
    }
  cout << ans;
}
