#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
const int maxn = 505;
const int inf = 1e9;
int n, m, k;
int dp[maxn];
string s;
int a[maxn];
int tot;
int f[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  while (n--) {
    cin >> s;
    tot = 0;
    for (int i = 0; i < m; i++) {
      if (s[i] == '1') {
        a[tot++] = i;
      }
    }
    for (int rm = 0; rm < tot; rm++) {
      f[rm] = inf;
      for (int i = 0; i <= rm && i < tot; i++) {
        int j = tot - 1 - (rm - i);
        if (j < i) break;
        f[rm] = min(f[rm], a[j] - a[i] + 1);
      }
    }
    f[tot] = 0;
    for (int rm = k; rm >= 0; rm--) {
      dp[rm] += f[0];
      for (int i = 1; i <= tot && rm - i >= 0; i++) {
        dp[rm] = min(dp[rm], dp[rm - i] + f[i]);
      }
    }
  }
  cout << dp[k] << endl;
  return 0;
}
