#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, i, j, l;
  char s[505];
  int c[505], q[505], dp[505][505];
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++) {
    cin >> s;
    int len = 0;
    for (j = 0; j < m; j++)
      if (s[j] == '1') c[++len] = j;
    for (l = 1; l <= len; l++) {
      q[l] = m;
      for (j = 1; j <= len - l + 1; j++)
        q[l] = min(q[l], c[j + l - 1] - c[j] + 1);
    }
    for (j = 0; j <= k; j++)
      for (l = min(len, j), dp[i][j] = i * m; l >= 0; l--)
        dp[i][j] = min(dp[i][j], dp[i - 1][j - l] + q[len - l]);
  }
  cout << dp[n][k];
  return 0;
}
