#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const long long mod = 998244353;
const int inf = 0x3f3f3f3f;
int co[maxn];
int val[505][505], dp[505][505];
string str;
int n, m, k;
int tim[505];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  memset(val, 0x3f, sizeof val);
  for (int i = 1; i <= n; i++) {
    cin >> str;
    int q = 0;
    memset(tim, 0, sizeof tim);
    for (int j = 0; j <= m - 1; j++) {
      if (str[j] == '1') tim[++q] = j;
    }
    for (int j = 0; j <= q; j++) {
      for (int u = 0; u <= j; u++)
        val[i][j] = min(val[i][j], tim[u + q - j] - tim[u + 1] + 1);
    }
    val[i][q] = 0;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= m; j++)
      if (val[i][j] < 0 || val[i][j] == 1061109567) val[i][j] = 0;
  memset(dp, 0x3f, sizeof dp);
  for (int i = 0; i <= k; i++) dp[0][i] = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= k; j++)
      for (int u = 0; u <= k - j; u++)
        dp[i][j + u] = min(dp[i][j + u], dp[i - 1][j] + val[i][u]);
  cout << dp[n][k];
}
