#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, m, k;
  cin >> n >> m >> k;
  string s[n];
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
  }
  long long del[n + 1][k + 1];
  for (long long i = 0; i <= n; i++) {
    for (long long j = 0; j <= k; j++) {
      del[i][j] = LONG_LONG_MAX;
    }
  }
  long long si[n + 1];
  vector<long long> pos[n + 1];
  for (long long i = 0; i < n; i++) {
    long long ctr = 0;
    for (long long j = 0; j < m; j++) {
      if (s[i][j] == '1') {
        pos[i + 1].push_back(j);
        ctr++;
      }
    }
    si[i + 1] = ctr;
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= k; j++) {
      if (j >= pos[i].size()) {
        del[i][j] = 0;
        continue;
      }
      long long temp = pos[i].size();
      for (long long m = 0; m < min(temp, j + 1); m++) {
        del[i][j] =
            min(del[i][j], pos[i][m + pos[i].size() - j - 1] - pos[i][m] + 1);
      }
    }
  }
  long long dp[n + 1][k + 1];
  for (long long i = 0; i <= n; i++) {
    for (long long j = 0; j <= k; j++) {
      dp[i][j] = 1e15;
    }
  }
  for (long long i = 0; i <= k; i++) {
    dp[0][i] = 0;
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= si[i]; j++) {
      for (long long m = j; m <= k; m++) {
        dp[i][m] = min(dp[i][m], del[i][j] + dp[i - 1][m - j]);
      }
    }
  }
  for (long long i = k; i >= 0; i--) {
    if (dp[n][i] != LONG_LONG_MAX) {
      cout << dp[n][i] << "\n";
      return 0;
    }
  }
}
