#include <bits/stdc++.h>
using namespace std;
string a[503];
int dp[503][503];
int b[503][503];
int d[503];
vector<int> v;
int main() {
  int n, m, k, ee;
  cin >> n >> m >> k;
  int i, j;
  string s;
  for (i = 0; i < n; i++) {
    cin >> s;
    a[i] = s;
  }
  int l, ll, jj, ii;
  for (i = 0; i < n; i++) {
    s = a[i];
    for (j = 0; j < m; j++) {
      if (s[j] == '1') v.push_back(j);
    }
    d[i] = v.size();
    ll = v.size();
    if (ll == 0) {
      continue;
    } else if (ll == 1) {
      b[i][1] = 1;
    } else {
      b[i][0] = 0;
      b[i][1] = 1;
      ee = INT_MAX;
      for (j = 2; j <= ll; j++) {
        ee = INT_MAX;
        for (jj = 0; jj < ll - j + 1; jj++) {
          ii = jj + j - 1;
          ee = min(ee, v[ii] - v[jj] + 1);
        }
        b[i][j] = ee;
      }
    }
    v.clear();
  }
  for (j = 0; j <= k; j++) {
    if (j >= d[0])
      dp[0][j] = 0;
    else
      dp[0][j] = b[0][d[0] - j];
  }
  for (i = 1; i < n; i++) {
    dp[i][0] = dp[i - 1][0] + b[i][d[i]];
    for (j = 1; j <= k; j++) {
      ee = INT_MAX;
      for (jj = 0; jj <= j; jj++) {
        if (jj >= d[i])
          ee = min(dp[i - 1][j - jj], ee);
        else
          ee = min(dp[i - 1][j - jj] + b[i][d[i] - jj], ee);
      }
      dp[i][j] = ee;
    }
  }
  cout << dp[n - 1][k];
}
