#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MAX = 1e5 + 5;
long long tree[3 * MAX];
long long MOD = 1e9 + 7;
long long fexpo(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b % 2) ans = (ans * a) % MOD;
    b /= 2;
    a = (a * a) % MOD;
  }
  return ans;
}
int32_t main() {
  long long n, m, k;
  cin >> n >> m >> k;
  long long pre[n + 1][m + 1];
  memset(pre, 0, sizeof(pre));
  for (long long i = 1; i <= n; i++) {
    string str;
    cin >> str;
    for (long long j = 0; j < str.size(); j++)
      pre[i][j + 1] = pre[i][j] + str[j] - '0';
  }
  long long dp1[n + 1][k + 1], dp2[n + 1][max(m, k) + 1];
  for (long long i = 0; i <= n; i++)
    for (long long j = 0; j <= m; j++) dp2[i][j] = INF;
  for (long long day = 1; day <= n; day++) {
    long long num_11 = 0;
    for (long long i = 1; i <= m; i++)
      for (long long j = i; j <= m; j++) {
        if (pre[day][i] > pre[day][i - 1] && pre[day][j] > pre[day][j - 1]) {
          long long skipped = pre[day][i - 1] + pre[day][m] - pre[day][j];
          dp2[day][skipped] = min(dp2[day][skipped], j - i + 1);
        }
      }
    for (long long i = pre[day][m]; i <= max(m, k); i++) dp2[day][i] = 0;
  }
  for (long long i = 0; i <= n; i++)
    for (long long j = 0; j <= k; j++) dp1[i][j] = INF;
  dp1[0][0] = 0;
  for (long long day = 1; day <= n; day++) {
    for (long long skip_tot = 0; skip_tot <= k; skip_tot++) {
      for (long long skip_cur = 0; skip_cur <= skip_tot; skip_cur++)
        dp1[day][skip_tot] =
            min(dp1[day][skip_tot],
                dp1[day - 1][skip_tot - skip_cur] + dp2[day][skip_cur]);
    }
  }
  long long ans = INF;
  for (long long i = 0; i <= k; i++) ans = min(ans, dp1[n][i]);
  cout << ans;
}
