#include <bits/stdc++.h>
using namespace std;
int m, n, k, sum, f[1005], g[505][505], dp[505][505];
char x;
int main() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    sum = 0;
    for (int j = 1; j <= m; j++) {
      cin >> x;
      if (x == '1') {
        sum++;
        f[sum] = j;
      }
    }
    for (int j = 0; j <= m; j++) g[i][j] = 0x3f3f3f;
    for (int k = 1; k <= sum; k++) {
      for (int j = 1; j <= sum - k + 1; j++)
        g[i][sum - k] = min(g[i][sum - k], f[j + k - 1] - f[j] + 1);
    }
    g[i][sum] = 0;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      dp[i][j] = 0x3f3f3f;
      for (int l = 0; l <= j; l++) {
        dp[i][j] = min(dp[i][j], dp[i - 1][j - l] + g[i][l]);
      }
    }
  }
  cout << dp[n][k] << endl;
  return 0;
}
