#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9 + 7;
vector<vector<int>> a, dp, compute;
int rec(int i, int k, int& n) {
  if (i == n) {
    return 0;
  }
  if (dp[i][k] > -1) {
    return dp[i][k];
  }
  int best = INF, p = a[i].size();
  for (int skip = 0; skip <= min(p, k); ++skip) {
    best = min(best, compute[i][skip] + rec(i + 1, k - skip, n));
  }
  return dp[i][k] = best;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  a.resize(n);
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < m; ++j) {
      if (s[j] == '1') {
        a[i].push_back(j);
      }
    }
  }
  dp = vector<vector<int>>(n + 1, vector<int>(k + 1, -1));
  compute = vector<vector<int>>(n, vector<int>(m + 1, INF));
  for (int i = 0; i < n; ++i) {
    int p = a[i].size();
    for (int beg = 0; beg <= p; ++beg) {
      for (int en = 0; en <= p - beg; ++en) {
        int attend = 0;
        if (beg + en < p) {
          attend = a[i][p - en - 1] - a[i][beg] + 1;
        }
        compute[i][beg + en] = min(compute[i][beg + en], attend);
      }
    }
  }
  cout << rec(0, k, n) << '\n';
}
