#include <bits/stdc++.h>
using namespace std;
const int N = 505 + 5;
const int MOD = 1e9 + 7;
long long best[N][N], n, m, k;
vector<long long> vec[N];
long long dp[N][N];
long long solve(long long i, long long j) {
  if (j > k) return 1e9;
  if (i == n + 1) return 0;
  if (dp[i][j] != -1) return dp[i][j];
  long long ret = 1e9;
  for (long long a = 0; a <= vec[i].size(); a++) {
    ret = min(ret, solve(i + 1, j + (vec[i].size() - a)) + best[i][a]);
  }
  return dp[i][j] = ret;
}
int main() {
  scanf("%lld%lld%lld", &n, &m, &k);
  for (long long a = 1; a <= n; a++) {
    for (long long b = 1; b <= m; b++) {
      char x;
      cin >> x;
      if (x == '1') vec[a].push_back(b);
    }
  }
  for (long long a = 1; a <= n; a++) {
    for (long long b = 1; b <= vec[a].size(); b++) {
      best[a][b] = 1e9;
      for (long long c = b - 1; c < vec[a].size(); c++)
        best[a][b] = min(best[a][b], vec[a][c] - vec[a][c - b + 1] + 1);
    }
  }
  for (long long a = n; a >= 1; a--) {
    for (long long b = k; b >= 0; b--) {
      dp[a][b] = 1e9;
      for (long long c = 0; c <= vec[a].size(); c++) {
        if (b + vec[a].size() - c <= k)
          dp[a][b] =
              min(dp[a][b], dp[a + 1][b + vec[a].size() - c] + best[a][c]);
      }
    }
  }
  printf("%lld\n", dp[1][0]);
  return 0;
}
