#include <bits/stdc++.h>
using namespace std;
int dp[600][600];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j <= k; ++j) dp[i][j] = 1e9;
  for (int i = 1; i <= n; ++i) {
    string s;
    cin >> s;
    s = " " + s;
    vector<int> pos;
    for (int j = 1; j <= m; ++j)
      if (s[j] == '1') pos.push_back(j);
    vector<int> cost(pos.size(), 1e9);
    for (int j = 0; j < pos.size(); ++j) {
      for (int l = j; l < pos.size(); ++l) {
        int sadf = pos.size() - (l - j + 1);
        cost[sadf] = min(cost[sadf], pos[l] - pos[j] + 1);
      }
    }
    cost.push_back(0);
    for (int j = 0; j <= k; ++j) {
      for (int l = 0; l < cost.size() && l <= j; ++l) {
        dp[i][j] = min(dp[i][j], dp[i - 1][j - l] + cost[l]);
      }
    }
  }
  cout << dp[n][k];
  return 0;
}
