#include <bits/stdc++.h>
using namespace std;
const int maxn = 505;
int dp[maxn];
char Map[maxn];
int n, m, k;
vector<pair<int, int> > v[maxn];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    cin >> Map;
    int cnt = 0;
    int local[maxn];
    memset(local, 0, sizeof(local));
    for (int j = 0; j < m; j++)
      if (Map[j] == '1') local[cnt++] = j + 1;
    int len_Max[maxn];
    memset(len_Max, 0, sizeof(len_Max));
    len_Max[cnt] = m;
    for (int x = 0; x < cnt; x++)
      for (int y = x; y < cnt; y++) {
        int len = m - (local[y] - local[x] + 1);
        int count = cnt - (y - x + 1);
        len_Max[count] = max(len_Max[count], len);
      }
    for (int t = 0; t <= k; t++) v[i].push_back(pair<int, int>(t, len_Max[t]));
  }
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    for (int j = k; j >= 0; j--) {
      for (int kx = 0; kx < v[i].size(); kx++) {
        if (j >= v[i][kx].first)
          dp[j] = max(dp[j], dp[j - v[i][kx].first] + v[i][kx].second);
      }
    }
  }
  printf("%d\n", n * m - dp[k]);
}
