#include <bits/stdc++.h>
using namespace std;
const int N = 505;
int dp[N][N], t[N], a[N], tot, n, m, k;
char s[N];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    tot = 0;
    for (int j = 0; j < m; j++)
      if (s[j] == '1') a[++tot] = j;
    for (int j = 1; j <= tot; j++) {
      t[j] = m;
      for (int l = 1; l + j - 1 <= tot; l++)
        t[j] = min(t[j], a[l + j - 1] - a[l] + 1);
    }
    for (int j = 0; j <= k; j++) {
      dp[i][j] = i * m;
      for (int l = min(j, tot); l >= 0; l--) {
        dp[i][j] = min(dp[i][j], dp[i - 1][j - l] + t[tot - l]);
      }
    }
  }
  printf("%d\n", dp[n][k]);
  return 0;
}
