#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500 + 7;
const int INF = 0x3f3f3f3f;
char s[MAXN];
vector<int> day[MAXN], value[MAXN];
int dp[MAXN], sz[MAXN];
int main() {
  int n, m, k, sum = 0;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    for (int j = 0; j < m; j++) {
      if (s[j] == '1') day[i].push_back(j);
    }
  }
  for (int i = 0; i < n; i++) {
    value[i].push_back(0);
    sz[i] = day[i].size();
    if (!sz[i]) continue;
    int tot = day[i][sz[i] - 1] - day[i][0] + 1;
    sum += tot;
    for (int j = 1; j < sz[i]; j++) {
      value[i].push_back(0);
      int p = sz[i] - j - 1;
      for (int o = 0; o + p < sz[i]; o++) {
        value[i][j] = max(value[i][j], tot - (day[i][o + p] - day[i][o] + 1));
      }
    }
    value[i].push_back(tot);
  }
  for (int i = 0; i < n; i++) {
    for (int j = k; j >= 0; j--) {
      int lim = min(j, sz[i]);
      for (int o = 0; o <= lim; o++) {
        dp[j] = max(dp[j], dp[j - o] + value[i][o]);
      }
    }
  }
  cout << sum - dp[k] << endl;
  return 0;
}
