#include <bits/stdc++.h>
using namespace std;
void solve() {
  int64_t n, m, k;
  cin >> n >> m >> k;
  vector<string> a(n);
  for (int64_t i = 0; i < n; ++i) {
    cin >> a[i];
  }
  vector<int64_t> mn(m + 1);
  vector<vector<unsigned long long int> > dp(
      n + 1, vector<unsigned long long int>(k + 1, n * m));
  for (int64_t i = 0; i <= k; ++i) {
    dp[0][i] = 0;
  }
  for (int64_t i = 0; i < n; ++i) {
    int64_t total_count = 0;
    vector<int64_t> max_count(m + 1, 0);
    vector<vector<int64_t> > count(m, vector<int64_t>(m));
    for (int64_t j = 0; j < m; ++j) {
      count[j][j] = ((a[i][j] == '1') ? 1 : 0);
      max_count[1] = max(max_count[1], count[j][j]);
      for (int64_t l = j + 1; l < m; ++l) {
        count[j][l] += count[j][l - 1] + ((a[i][l] == '1') ? 1 : 0);
        int64_t length = l - j + 1;
        max_count[length] = max(max_count[length], count[j][l]);
      }
    }
    total_count = max_count[m];
    for (int64_t length = m; length >= 0; --length) {
      mn[total_count - max_count[length]] = length;
    }
    for (int64_t j = 0; j <= k; ++j) {
      for (int64_t l = 0; l <= j; ++l) {
        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - l] + mn[l]);
      }
    }
  }
  cout << dp[n][k];
}
int main() {
  solve();
  return 0;
}
