#include <bits/stdc++.h>
using namespace std;
int const N = 1e6 + 10;
long long int const LINF = numeric_limits<long long int>::max();
int const INF = numeric_limits<int>::max();
long long int gcd(long long int a, long long int b) {
  return (b == 0 ? a : gcd(b, a % b));
}
long long int lcm(long long int a, long long int b) {
  long long int g = gcd(a, b);
  return (a / g) * b;
}
long long int inv_mod(long long int a, long long int b) {
  long long int x = 0, y = 1, r, q, ta = a;
  while (b) {
    q = a / b;
    r = a % b;
    a = b;
    b = r;
    r = x;
    x = y;
    y = r - q * y;
  }
  x += ta;
  return x % ta;
}
long long int pow_mod(long long int a, long long int e, long long int m) {
  long long int res = 1;
  while (e) {
    if (e & 1) res = res * a % m;
    a = a * a % m;
    e >>= 1;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  string str[n];
  for (int i = 0; i < n; i++) {
    cin >> str[i];
  }
  vector<vector<int> > dp(n + 1, vector<int>(k + 1, N));
  vector<vector<int> > cnt(n + 1, vector<int>(k + 1, 0));
  vector<int> cc(n + 1, 0);
  for (int i = 0; i < n; i++) {
    vector<int> mh;
    for (int j = 0; j < m; j++) {
      if (str[i][j] == '1') mh.push_back(j + 1);
    }
    if (!mh.empty()) {
      int tn = mh.size();
      cc[i + 1] = tn;
      for (int j = 0; j <= k; j++) cnt[i + 1][j] = mh[tn - 1] - mh[0] + 1;
      for (int j = 0; j < tn; j++) {
        for (int l = j; l < tn; l++) {
          if (tn - (l - j + 1) <= k) {
            cnt[i + 1][tn - (l - j + 1)] =
                min(cnt[i + 1][tn - (l - j + 1)], mh[l] - mh[j] + 1);
          }
        }
      }
      if (tn <= k) cnt[i + 1][tn] = 0;
    }
  }
  for (int i = 0; i <= k; i++) dp[0][i] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      for (int l = 0; l <= j; l++) {
        if (l <= cc[i]) {
          dp[i][j] = min(dp[i - 1][j - l] + cnt[i][l], dp[i][j]);
        } else {
          dp[i][j] = min(dp[i - 1][j] + cnt[i][l], dp[i][j]);
        }
      }
    }
  }
  cout << dp[n][k] << endl;
}
