#include <bits/stdc++.h>
using namespace std;
int n, m, K;
char maze[610][610];
int dp[610][610];
int fro[610][610], pre[610][610];
int mans[610][610];
vector<int> vec[610];
int sum = 0;
int main() {
  cin >> n >> m >> K;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> maze[i][j];
      if (maze[i][j] == '1') {
        vec[i].push_back(j);
      }
    }
    if (vec[i].size() == 0) {
      continue;
    }
    sum += vec[i][vec[i].size() - 1] - vec[i][0] + 1;
  }
  for (int i = 1; i <= n; i++) {
    fro[i][0] = 0;
    pre[i][0] = 0;
    if (vec[i].size() == 0) {
      continue;
    }
    for (int j = 1; j < vec[i].size(); j++) {
      fro[i][j] = vec[i][j] - vec[i][0];
    }
    fro[i][vec[i].size()] = vec[i][vec[i].size() - 1] - vec[i][0] + 1;
    for (int j = 1; j < vec[i].size(); j++) {
      pre[i][j] = vec[i][vec[i].size() - 1] - vec[i][vec[i].size() - 1 - j];
    }
    pre[i][vec[i].size()] = vec[i][vec[i].size() - 1] - vec[i][0] + 1;
    ;
  }
  for (int i = 1; i <= n; i++) {
    int num = vec[i].size();
    mans[i][0] = 0;
    for (int j = 1; j < num; j++) {
      mans[i][j] = 0;
      for (int k = 0; k <= j; k++) {
        mans[i][j] = max(mans[i][j], fro[i][k] + pre[i][j - k]);
      }
    }
    mans[i][num] = pre[i][num];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= K; j++) {
      for (int k = 0; k <= vec[i].size(); k++) {
        if (k <= j) {
          dp[i][j] = max(dp[i][j], dp[i - 1][j - k] + mans[i][k]);
        } else {
          break;
        }
      }
    }
  }
  cout << sum - dp[n][K] << endl;
  return 0;
}
