#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
string s[600];
int pos[600][600];
int num[600];
int v[600][600];
int dp[600];
int main() {
  memset(num, 0, sizeof(int) * 600);
  memset(dp, 0, sizeof(int) * 600);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    for (int j = 0; j < m; j++)
      if (s[i][j] == '1') {
        num[i]++;
        pos[i][num[i]] = j;
      }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= min(k, num[i]); j++) {
      int res = INF;
      for (int p = 0; p <= j; p++) {
        int q = j - p;
        res = min(res, pos[i][num[i] - q] + 1 - pos[i][p + 1]);
      }
      v[i][j] = m - res;
    }
    v[i][num[i]] = m;
  }
  for (int i = 0; i < n; i++)
    for (int j = k; j >= 0; j--)
      for (int q = 0; q <= min(j, num[i]); q++)
        dp[j] = max(dp[j], dp[j - q] + v[i][q]);
  printf("%d\n", m * n - dp[k]);
  return 0;
}
