#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  const int inf = 1e9;
  int dp[502][502], a[502][502];
  memset(a, -1, sizeof(a));
  for (int i = 0; i < 502; i++) {
    for (int j = 0; j < 502; j++) {
      dp[i][j] = i == 0 ? 0 : inf;
      a[i][j] = inf;
    }
  }
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    vector<int> id;
    for (int j = 0; j < m; j++) {
      if (s[j] == '1') id.push_back(j);
    }
    for (int j = 0; j < id.size(); j++) {
      for (int l = j; l < id.size(); l++) {
        int skip = (int)id.size() - (l - j + 1);
        a[i][skip] = min(a[i][skip], id[l] - id[j] + 1);
      }
    }
  }
  for (auto& i : a) {
    for (int& j : i) {
      if (j == inf) {
        j = 0;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      for (int l = 0; l <= j; l++) {
        dp[i][j] = min(dp[i][j], dp[i - 1][j - l] + a[i][l]);
      }
    }
  }
  cout << dp[n][k] << "\n";
}
signed main() {
  solve();
  return 0;
}
