#include <bits/stdc++.h>
using namespace std;
int MOD = 1000000;
long long POW(long long a, long long b, long long MMM = MOD) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MMM)
    if (b & 1) ret = (ret * a) % MMM;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, -1, 1, 0}, dy[] = {1, 0, 0, -1};
int ddx[] = {0, 0, 1, 1, 1, -1, -1, -1}, ddy[] = {1, -1, 1, 0, -1, 1, 0, -1};
int a[500][500];
int d[500][501];
vector<int> v[500];
vector<int> vv[500];
int n, m, k;
void ini(int i) {
  for (int(j) = (0); (j) <= (m - 1); (j) += (1))
    if (a[i][j] == 1) v[i].push_back(j);
}
void go(int i) {
  vv[i].push_back(0);
  if (v[i].empty()) return;
  int N = v[i].size();
  int t = v[i].back() - v[i][0] + 1;
  for (int(k) = (N - 2); (k) >= (0); (k) -= (1)) {
    int temp = 987654321;
    for (int j = 0; k + j < N; j++) {
      temp = min(temp, v[i][k + j] - v[i][j] + 1);
    }
    vv[i].push_back(t - temp);
  }
  vv[i].push_back(t);
}
int go(int N, int K) {
  if (N == n) return 0;
  int &ret = d[N][K];
  if (ret != -1) return ret;
  ret = 0;
  int tt = min((int)vv[N].size() - 1, K);
  for (int(i) = (0); (i) <= (tt); (i) += (1)) {
    ret = max(ret, vv[N][i] + go(N + 1, K - i));
  }
  return ret;
}
int main() {
  memset(d, -1, sizeof(d));
  ;
  scanf("%d%d%d", &n, &m, &k);
  for (int(i) = (0); (i) <= (n - 1); (i) += (1))
    for (int(j) = (0); (j) <= (m - 1); (j) += (1)) scanf("%1d", &a[i][j]);
  int ans = 0;
  for (int(i) = (0); (i) <= (n - 1); (i) += (1)) {
    ini(i);
    go(i);
    if (v[i].empty()) continue;
    ans += v[i].back() - v[i][0] + 1;
  }
  printf("%d", ans - go(0, k));
}
