#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
T div_floor(T a, T b) {
  if (b < 0) a *= -1, b *= -1;
  return a >= 0 ? a / b : (a + 1) / b - 1;
}
template <class T>
T div_ceil(T a, T b) {
  if (b < 0) a *= -1, b *= -1;
  return a > 0 ? (a - 1) / b + 1 : a / b;
}
constexpr long long mod = 1000000007;
constexpr long long INF = mod * mod;
constexpr int MAX = 200010;
int main() {
  int n, m, K;
  scanf("%d%d%d", &n, &m, &K);
  string s[n];
  vector<int> pos[n];
  for (int((i)) = (int)(0); ((i)) < (int)((n)); ++((i))) {
    cin >> s[i];
    for (int((j)) = (int)(0); ((j)) < (int)((m)); ++((j)))
      if (s[i][j] == '1') pos[i].push_back(j);
  }
  int min_len[n][K + 1];
  for (int((i)) = (int)(0); ((i)) < (int)((n)); ++((i))) {
    for (int((k)) = (int)(0); ((k)) < (int)((K + 1)); ++((k)))
      min_len[i][k] = mod;
    if ((int)pos[i].size() <= K) min_len[i][pos[i].size()] = 0;
    for (int((l)) = (int)(0); ((l)) < (int)((pos[i].size())); ++((l)))
      for (int(r) = (int)(l); (r) < (int)(pos[i].size()); ++(r)) {
        int del = (int)pos[i].size() - (r - l + 1);
        if (del <= K) chmin(min_len[i][del], pos[i][r] - pos[i][l] + 1);
      }
  }
  int dp[2][K + 1];
  for (int((i)) = (int)(0); ((i)) < (int)((2)); ++((i)))
    for (int((j)) = (int)(0); ((j)) < (int)((K + 1)); ++((j))) dp[i][j] = mod;
  dp[0][0] = 0;
  for (int((i)) = (int)(0); ((i)) < (int)((n)); ++((i))) {
    for (int((j)) = (int)(0); ((j)) < (int)((K + 1)); ++((j)))
      if (dp[0][j] < mod) {
        for (int((k)) = (int)(0); ((k)) < (int)((K + 1)); ++((k)))
          if (j + k <= K) {
            chmin(dp[1][j + k], dp[0][j] + min_len[i][k]);
          }
      }
    for (int((j)) = (int)(0); ((j)) < (int)((K + 1)); ++((j))) {
      dp[0][j] = dp[1][j];
      dp[1][j] = mod;
    }
  }
  int ans = mod;
  for (int((i)) = (int)(0); ((i)) < (int)((K + 1)); ++((i)))
    chmin(ans, dp[0][i]);
  printf("%d\n", ans);
}
