#include <bits/stdc++.h>
using namespace std;
const int N = 505;
int n, m, kk, a[N], f[N], ans[N][N], anss;
int main() {
  scanf("%d%d%d", &n, &m, &kk);
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int j = 1; j <= m; j++) {
      char c;
      scanf(" %c", &c);
      if (c == '1') {
        a[++cnt] = j;
      }
    }
    for (int j = 0; j <= min(cnt, kk); j++) {
      f[j] = 1e9;
      for (int k = 0; k <= j; k++) {
        f[j] = min(f[j], a[cnt - j + k] - a[1 + k] + 1);
      }
    }
    if (cnt <= kk) {
      f[cnt] = 0;
    }
    for (int j = 0; j <= kk; j++) {
      ans[i][j] = 1e9;
      for (int k = 0; k <= min(j, cnt); k++) {
        ans[i][j] = min(ans[i][j], ans[i - 1][j - k] + f[k]);
      }
    }
  }
  anss = 1e9;
  for (int i = 0; i <= kk; i++) {
    anss = min(anss, ans[n][i]);
  }
  printf("%d", anss);
  return 0;
}
