#include <bits/stdc++.h>
using namespace std;
char s[501][501];
int f[501][501], dp[501][501], ls[501];
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i] + 1);
    int all = 0;
    for (int j = 1; j <= m; j++) {
      if (s[i][j] == '1') ls[++all] = j;
    }
    for (int j = 0; j < all; j++) {
      f[i][j] = 99999999;
      for (int t = 1; t <= j + 1; t++)
        f[i][j] = min(f[i][j], ls[t + all - j - 1] - ls[t] + 1);
    }
    for (int j = all; j <= k; j++) f[i][j] = 0;
  }
  for (int i = 0; i <= n; i++) dp[0][i] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      dp[i][j] = 999999;
      for (int t = 0; t <= j; t++)
        dp[i][j] = min(dp[i - 1][j - t] + f[i][t], dp[i][j]);
    }
  }
  printf("%d\n", dp[n][k]);
  return 0;
}
