#include <bits/stdc++.h>
using namespace std;
string s[505];
vector<int> v;
int p[505][505];
int dp[505][505];
int main() {
  int n, m, x;
  scanf("%d %d %d", &n, &m, &x);
  int ans = 0;
  for (int i = 1; i <= n; i++) cin >> s[i];
  for (int i = 1; i <= n; i++) {
    v.clear();
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '1') v.push_back(j);
    }
    int Size = v.size();
    if (Size == 0) continue;
    int now = 0;
    if (Size == 1)
      now = 1;
    else
      now = (v[Size - 1] - v[0] + 1);
    ans += now;
    p[i][0] = 0;
    for (int j = 1; j < Size; j++) {
      p[i][j] = 0;
      for (int k = 0; k <= j; k++)
        p[i][j] =
            max(p[i][j], v[k] - v[0] + v[Size - 1] - v[Size - 1 - (j - k)]);
    }
    p[i][Size] = now;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= x; j++) {
      for (int k = 0; k <= j; k++) {
        dp[i][j] = max(dp[i][j], dp[i - 1][j - k] + p[i][k]);
      }
    }
  }
  int mx = 0;
  for (int j = 0; j <= x; j++) mx = max(mx, dp[n][j]);
  cout << ans - mx << endl;
}
