#include <bits/stdc++.h>
using namespace std;
int n, m, k, f[501][501], C[501][501];
char can[501][501];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%s", can[i]);
    for (int j = m; j; --j) can[i][j] = can[i][j - 1];
  }
  memset(f, 0, sizeof(f));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (can[i][j] == '1' && i > 1 && can[i - 1][j] == '1' && i < n &&
          can[i + 1][j] == '1' && j > 1 && can[i][j - 1] == '1' && j < m &&
          can[i][j + 1] == '1')
        f[i][j] = 1;
  for (int i = 1; i <= n; i++) {
    C[i][0] = 0;
    for (int j = 1; j <= m; j++) C[i][j] = C[i][j - 1] + f[i][j];
  }
  long long ans = 0;
  for (int left = 1; left <= m; left++)
    for (int right = left; right <= m; right++) {
      int star = 0;
      for (int up = 1, down = 1; up <= n; up++) {
        while (down < n && star < k)
          star += (C[++down][right - 1] - C[down][left]);
        if (star >= k) ans += n - down;
        star -= C[up + 1][right - 1] - C[up + 1][left];
      }
    }
  printf("%I64d\n", ans);
}
