#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
int n;
int m;
int k;
int x[2500][2500];
string s[2500];
long long ans;
int go(int i1, int j1, int i2, int j2) {
  if (i1 == i2 && j1 == j2) {
    if (k == 0) ans += int(x[i1][j1] == 0);
    if (k == 1) ans += int(x[i1][j1] == 1);
    return 0;
  }
  int t;
  int **a;
  int **b;
  if (i2 - i1 > j2 - j1) {
    int is = (i1 + i2) / 2;
    go(i1, j1, is, j2);
    go(is + 1, j1, i2, j2);
    t = j2 - j1 + 1;
    a = new int *[t];
    b = new int *[t];
    for (int j = 0; j < t; j++) {
      a[j] = new int[k + 1];
      int r = 0;
      int i = is;
      while (r < k + 1 && i >= i1) {
        if (x[i][j + j1] == 1) a[j][r++] = is - i;
        i--;
      }
      while (r < k + 1) a[j][r++] = is - i1 + 1;
    }
    for (int j = 0; j < t; j++) {
      b[j] = new int[k + 1];
      int r = 0;
      int i = is + 1;
      while (r < k + 1 && i <= i2) {
        if (x[i][j + j1] == 1) b[j][r++] = i - is - 1;
        i++;
      }
      while (r < k + 1) b[j][r++] = i2 - is;
    }
  } else {
    int js = (j1 + j2) / 2;
    go(i1, j1, i2, js);
    go(i1, js + 1, i2, j2);
    t = i2 - i1 + 1;
    a = new int *[t];
    b = new int *[t];
    for (int i = 0; i < t; i++) {
      a[i] = new int[k + 1];
      int r = 0;
      int j = js;
      while (r < k + 1 && j >= j1) {
        if (x[i + i1][j] == 1) a[i][r++] = js - j;
        j--;
      }
      while (r < k + 1) a[i][r++] = js - j1 + 1;
    }
    for (int i = 0; i < t; i++) {
      b[i] = new int[k + 1];
      int r = 0;
      int j = js + 1;
      while (r < k + 1 && j <= j2) {
        if (x[i + i1][j] == 1) b[i][r++] = j - js - 1;
        j++;
      }
      while (r < k + 1) b[i][r++] = j2 - js;
    }
  }
  int *c = new int[k + 1];
  int *d = new int[k + 1];
  int *e = new int[k + 1];
  for (int ja = 0; ja < t; ja++) {
    for (int jb = ja; jb < t; jb++) {
      if (jb == ja) {
        for (int i = 0; i <= k; i++) {
          c[i] = a[ja][i];
          d[i] = b[ja][i];
        }
      } else {
        {
          int r = 0, s = 0, o = 0;
          while (r < k + 1)
            if (c[s] <= a[jb][o])
              e[r++] = c[s++];
            else
              e[r++] = a[jb][o++];
          for (int i = 0; i <= k; i++) c[i] = e[i];
        }
        {
          int r = 0, s = 0, o = 0;
          while (r < k + 1)
            if (d[s] <= b[jb][o])
              e[r++] = d[s++];
            else
              e[r++] = b[jb][o++];
          for (int i = 0; i <= k; i++) d[i] = e[i];
        }
      }
      for (int r = 0; r <= k; r++) {
        int c1, c2;
        if (r == 0)
          c1 = c[0];
        else
          c1 = c[r] - c[r - 1];
        if (r == k)
          c2 = d[0];
        else
          c2 = d[k - r] - d[k - r - 1];
        ans += c1 * c2;
      }
    }
  }
  delete[] c;
  delete[] d;
  delete[] e;
  for (int i = 0; i < t; i++) {
    delete[] a[i];
    delete[] b[i];
  }
  delete[] a;
  delete[] b;
  return 0;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) x[i][j] = s[i][j] - '0';
  ans = 0;
  go(0, 0, n - 1, m - 1);
  cout << ans << endl;
  cerr << clock() << endl;
  return 0;
}
