#include <bits/stdc++.h>
using namespace std;
int n, m, o, g[505][505], f[505][505], l, r, a[505], cnt, tmp[505];
char s[505];
int main() {
  int i, j, k;
  scanf("%d%d%d", &n, &m, &o);
  for (i = 1; i <= n; i++) {
    memset(tmp, 0, sizeof(tmp));
    scanf("%s", s + 1);
    cnt = 0;
    for (j = 1; j <= m; j++)
      if (s[j] == '1') a[++cnt] = j;
    g[1][cnt] = (a[1] - 1) + (m - a[cnt]);
    tmp[0] = g[1][cnt];
    for (j = cnt - 1; j >= 1; j--) {
      for (k = 1; k <= cnt - j + 1; k++) {
        l = k;
        r = k + j - 1;
        g[l][r] = max(l > 1 ? g[l - 1][r] + a[l] - a[l - 1] : 0,
                      r < cnt ? g[l][r + 1] + a[r + 1] - a[r] : 0);
        tmp[cnt - j] = max(tmp[cnt - j], g[l][r]);
      }
    }
    tmp[cnt] = m;
    for (j = 0; j <= o; j++)
      for (k = 0; k <= j; k++) f[i][j] = max(f[i][j], f[i - 1][j - k] + tmp[k]);
  }
  printf("%d\n", n * m - f[n][o]);
  return 0;
}
