#include <bits/stdc++.h>
using namespace std;
const int inf = 510101010;
const int mod = 1e9 + 7;
const long long longinf = 1LL << 60;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  string s[n];
  vector<int> v[n];
  for (int i = 0; i < (int)(n); i++) {
    cin >> s[i];
    for (int j = 0; j < (int)(m); j++)
      if (s[i][j] == '1') v[i].push_back(j);
  }
  int t[n][505];
  for (int i = 0; i < (int)(n); i++) {
    for (int j = 0; j < (int)(505); j++) t[i][j] = inf;
    int sz = v[i].size();
    for (int j = 0; j < (int)(sz); j++) {
      for (int h = 0; h < (int)(j + 1); h++) {
        t[i][j] = min(t[i][j], v[i][h + sz - j - 1] - v[i][h] + 1);
      }
    }
    for (int j = sz; j < (int)(k + 1); j++) t[i][j] = 0;
  }
  int dp[505][505];
  for (int i = 0; i < (int)(k + 1); i++) dp[0][i] = 0;
  for (int i = 0; i < (int)(n); i++) {
    for (int j = 0; j < (int)(k + 1); j++) {
      dp[i + 1][j] = inf;
      for (int h = 0; h < (int)(j + 1); h++) {
        dp[i + 1][j] = min(dp[i + 1][j], dp[i][h] + t[i][j - h]);
      }
    }
  }
  cout << dp[n][k] << endl;
  return 0;
}
