#include <bits/stdc++.h>
using namespace std;
template <typename c>
void amax(c &x, c y) {
  x = max(x, y);
}
template <typename c>
void amin(c &x, c y) {
  x = min(x, y);
}
const int maxn = 500 + 5;
vector<int> v;
int a[maxn][maxn];
int dp[maxn][maxn];
int n, m, k;
int32_t main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  memset(a, 63, sizeof a);
  memset(dp, 63, sizeof dp);
  fill(dp[0], dp[0] + maxn, 0);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) {
      if (s[j] == '1') v.emplace_back(j);
    }
    for (int j = 0; j < maxn; j++) {
      if (j >= (int)(v).size()) {
        a[i][j] = 0;
        continue;
      }
      for (int x = 0; x <= j; x++) {
        amin(a[i][j], v[(int)(v).size() - 1 - (j - x)] - v[x] + 1);
      }
    }
    v.clear();
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      for (int x = 0; x <= j; x++) {
        amin(dp[i][j], dp[i - 1][j - x] + a[i - 1][x]);
      }
    }
  }
  cout << dp[n][k] << endl;
  return 0;
}
