#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<string> tt(n);
  for (int i = 0; i < n; ++i) {
    cin >> tt[i];
  }
  int const INF = 1000000000;
  vector<int> dp(k + 1, INF), ndp(k + 1, INF);
  dp[0] = 0;
  for (int day = 0; day < n; ++day) {
    vector<int> prefix(m + 1);
    for (int i = 0; i < m; ++i) {
      prefix[i + 1] = prefix[i] + (tt[day][i] == '1');
    }
    vector<int> update(m + 1, INF);
    for (int arr = 0; arr <= m; ++arr) {
      for (int dep = arr; dep <= m; ++dep) {
        int plus_time = dep - arr;
        int plus_sk = prefix[m] - (prefix[dep] - prefix[arr]);
        update[plus_sk] = min(update[plus_sk], plus_time);
      }
    }
    for (int sk = 0; sk <= k; ++sk) {
      for (int plus_sk = 0; plus_sk <= m && sk + plus_sk <= k; ++plus_sk) {
        ndp[sk + plus_sk] = min(ndp[sk + plus_sk], dp[sk] + update[plus_sk]);
      }
    }
    dp.assign(k + 1, INF);
    dp.swap(ndp);
  }
  int result = INF;
  for (int sk = 0; sk <= k; ++sk) {
    result = min(result, dp[sk]);
  }
  cout << result << endl;
}
