#include <bits/stdc++.h>
using namespace std;
int n, m, l, p[505], cost[505][505], dp[505][505];
char a[505][505];
int main() {
  scanf("%d%d%d", &n, &m, &l);
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  for (int i = 1; i <= n; i++) {
    int q = 0;
    for (int j = 1; j <= m; j++)
      if (a[i][j] == '1') p[++q] = j;
    for (int k = 0; k <= l && k < q; k++) {
      int cnt = q - k;
      int best = INT_MAX;
      for (int j = 1; j <= q; j++) {
        int st = j - cnt + 1;
        if (st >= 1) best = min(best, p[j] - p[st] + 1);
      }
      cost[i][k] = best;
    }
  }
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= l; j++) dp[i][j] = INT_MAX;
  for (int i = 0; i <= l; i++) dp[n + 1][i] = 0;
  for (int i = n; i > 0; i--) {
    for (int k = 0; k <= l; k++) {
      for (int j = 0; j + k <= l; j++) {
        if (cost[i][j] == INT_MAX) continue;
        if (dp[i + 1][k + j] != INT_MAX &&
            dp[i + 1][k + j] + cost[i][j] < dp[i][k])
          dp[i][k] = dp[i + 1][k + j] + cost[i][j];
      }
    }
  }
  printf("%d\n", dp[1][0]);
  return 0;
}
