#include <bits/stdc++.h>
using namespace std;
char a[505][505];
int b[505][505], dp[505][505], sum[505], n, m, k;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  memset(b, 0x3F, sizeof(b));
  memset(dp, 0x3F, sizeof(dp));
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    vector<int> V;
    for (int j = 0; j < m; j++)
      if (a[i][j] == '1') V.push_back(j);
    sum[i] = (int)V.size();
    for (int j = 0; j < (int)V.size(); j++) {
      for (int q = j; q < (int)V.size(); q++) {
        b[i][q - j + 1] = min(b[i][q - j + 1], V[q] - V[j] + 1);
      }
    }
    b[i][0] = 0;
  }
  memset(dp[0], 0, sizeof(dp[0]));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= k; j++) {
      for (int q = 0; q <= k - j; q++) {
        int have = sum[i + 1] - q;
        dp[i + 1][j + q] = min(dp[i + 1][j + q], dp[i][j] + b[i + 1][have]);
      }
    }
  }
  cout << dp[n][k] << endl;
  return 0;
}
