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