Ivan is a student at Berland State University (BSU). There are n days in Berland week, and each of these days Ivan might have some classes at the university.

There are m working hours during each Berland day, and each lesson at the university lasts exactly one hour. If at some day Ivan's first lesson is during i-th hour, and last lesson is during j-th hour, then he spends j - i + 1 hours in the university during this day. If there are no lessons during some day, then Ivan stays at home and therefore spends 0 hours in the university.

Ivan doesn't like to spend a lot of time in the university, so he has decided to skip some lessons. He cannot skip more than k lessons during the week. After deciding which lessons he should skip and which he should attend, every day Ivan will enter the university right before the start of the first lesson he does not skip, and leave it after the end of the last lesson he decides to attend. If Ivan skips all lessons during some day, he doesn't go to the university that day at all.

Given n, m, k and Ivan's timetable, can you determine the minimum number of hours he has to spend in the university during one week, if he cannot skip more than k lessons?

Input

The first line contains three integers n, m and k (1 ≤ n, m ≤ 500, 0 ≤ k ≤ 500) — the number of days in the Berland week, the number of working hours during each day, and the number of lessons Ivan can skip, respectively.

Then n lines follow, i-th line containing a binary string of m characters. If j-th character in i-th line is 1, then Ivan has a lesson on i-th day during j-th hour (if it is 0, there is no such lesson).

Output

Print the minimum number of hours Ivan has to spend in the university during the week if he skips not more than k lessons.

Examples

Input

2 5 1
01001
10110


Output

5


Input

2 5 0
01001
10110


Output

8

Note

In the first example Ivan can skip any of two lessons during the first day, so he spends 1 hour during the first day and 4 hours during the second day.

In the second example Ivan can't skip any lessons, so he spends 4 hours every day.
import java.io.*;
import java.util.*;

public class _946D {
    /**********************************************************************************************
     *                                            DEBUG                                           *
     *  - Obvious dp would be try to remember state of the board but that's too slow because
     *      - there are m^2 states for each day, there are n days => there are m^2n for the whole board
     *      - each check cost m calculations for the hashcode and equals
     *  -
     **********************************************************************************************/
    private final static boolean DEBUG = false;
    private final static String[] DEBUG_INPUT = {
            "2 5 1\n" +
                    "01001\n" +
                    "10110",
            "2 5 0\n" +
                    "01001\n" +
                    "10110",
            "3 4 0\n" +
                    "0000\n" +
                    "0000\n" +
                    "0000",
            "3 4 12\n" +
                    "1111\n" +
                    "1111\n" +
                    "1111",
            "4 4 7\n" +
                    "1001\n" +
                    "1001\n" +
                    "1001\n" +
                    "1001\n"
    };
//    static {
//        StringBuilder sb = new StringBuilder();
//        Random random = new Random();
//        sb.append("500 500 500\n");
//        for (int i = 0; i < 500; i++) {
//            StringBuilder sbRow = new StringBuilder();
//            for (int j = 0; j < 500; j++) {
//                sbRow.append(random.nextInt(10) % 2);
//            }
//            sb.append("\n");
//            sb.append(sbRow.toString());
//        }
//        DEBUG_INPUT[0] = sb.toString();
//    }



    /**********************************************************************************************
     *                                             MAIN                                           *
     **********************************************************************************************/
    // input

    // 2 5 1
    // 01001
    // 10110

    // output
    // 5

    // 2 8 2
    // 10100011
    // 10011100
    // 4/8  4/6
    // - graph
    // - dp
    //      - state: remaining days, the remaining timetable: 500 x (left, right)
    private static class Solver {
        private static final int MIN = -999_999_999;
        private static final int MAX = 999_999_999;

        public void solve(Reader in, PrintWriter out) throws IOException {
            int n = in.nextInt();
            int m = in.nextInt();
            int k = in.nextInt();
            char[][] a = new char[n][];
            for (int i = 0; i < n; i++) a[i] = in.nextWord().toCharArray();
            out.print(solve(n, m, k, a));
        }

        private int solve(int n, int m, int k, char[][] a) {
            int[] oneCount = new int[n];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    if (a[i][j] == '1') oneCount[i]++;
                }
            }

            // if we skip j first 1(s) in i-th row, where would the next 1 be
            int[][][] skipTable = new int[n][m+1][2]; // 0: left -> right, 1: right -> left
            for (int i = 0; i < n; i++) {
                for (int j = 0; j <= m; j++) {
                    skipTable[i][j][0] = skipTable[i][j][1] = -1;
                }
            }
            for (int i = 0; i < n; i++) {
                int countLeft = 0;
                int countRight = 0;
                for (int j = 0; j < m; j++) {
                    if (a[i][j] == '1') {
                        countLeft++;
                        skipTable[i][countLeft-1][0] = j;
                    }
                    if (a[i][m-1-j] == '1') {
                        countRight++;
                        skipTable[i][countRight-1][1] = m-1-j;
                    }
                }
            }

            int[][] eachDay = new int[n][k+1]; // [i][j] is minimum hours of day i if skip j lessons
            for (int[] i : eachDay) Arrays.fill(i, MAX);

            for (int i = 0; i < n; i++) {
                int skippable = Math.min(oneCount[i], k);
                for (int j = 0; j <= skippable; j++) {
                    int res = MAX;
                    for (int l = 0; l <= j; l++) {
                        int skipLeft = l;
                        int skipRight = j - skipLeft;
                        int first1Left = skipTable[i][skipLeft][0];
                        int first1Right = skipTable[i][skipRight][1];
                        if (first1Left == -1 || first1Right == -1 || first1Left > first1Right) {
                            res = 0;
                            break;
                        } else {
                            res = Math.min(res, first1Right - first1Left + 1);
                        }
                    }
                    eachDay[i][j] = res;
                }
            }

            int[][] dp = new int[n][k+1]; // [i][j] is minimum hours need to spend if skip j lessons in first i days
            for (int i = 0; i < n; i++) {
                int skippable = Math.min(oneCount[i], k);
                for (int j = 0; j <= k; j++) { // if we skip j lessons in first i days
                    int res = MAX;
                    int skippable2 = Math.min(j, skippable);
                    for (int l = 0; l <= skippable2; l++) { // if we skip l lessons in i-th day
                        int prev = i == 0 ? 0 : dp[i-1][j-l];
                        res = Math.min(res, prev + eachDay[i][l]);
                    }
                    dp[i][j] = res;
                }
            }

            return dp[n-1][k];
        }

//        private int solve(int n, int m, int k, char[][] a) {
//            int[][][] nextTable = new int[n][m][2]; // 0: left -> right, 1: right -> left
//            for (int i = 0; i < n; i++) {
//                for (int j = 0; j < m; j++) {
//                    nextTable[i][j][0] = nextTable[i][j][1] = -1;
//                }
//            }
//            int[][] intervals = new int[n][2]; // 0: left, 1: right
//            for (int[] i :intervals) {
//                i[0] = 0;
//                i[1] = -1;
//            }
//            for (int i = 0; i < n; i++) {
//                int prevOneL2RIdx = -1;
//                int prevOneR2LIdx = m;
//                for (int j = 0; j < m; j++) {
//                    if (a[i][j] == '1') {
//                        if (prevOneL2RIdx != -1) nextTable[i][prevOneL2RIdx][0] = j;
//                        prevOneL2RIdx = j;
//                    }
//                    if (a[i][m-1-j] == '1') {
//                        if (prevOneR2LIdx != m) nextTable[i][prevOneR2LIdx][1] = m-1-j;
//                        prevOneR2LIdx = m-1-j;
//                    }
//                }
//                for (int j = 0; j < m; j++) {
//                    if (a[i][j] == '1') {
//                        intervals[i][0] = j;
//                        break;
//                    }
//                }
//                for (int j = m-1; j >=0; j--) {
//                    if (a[i][j] == '1') {
//                        intervals[i][1] = j;
//                        break;
//                    }
//                }
//            }
//            State origin = new State(intervals, k);
//            Map<State, Integer> memo = new HashMap<>();
//            return go(memo, nextTable, origin);
//        }
//
//        private int go(Map<State, Integer> memo, int[][][] table, State state) {
//            Integer cache = memo.get(state);
//            if (cache != null) return cache;
//
//            if (state.remainDays == 0) return state.calculateCost();
//
//            int res = Integer.MAX_VALUE;
//            for (int i = 0; i < state.intervals.length; i++) {
//                State delete = state.delete(table, i, 0);
//                if (delete != null) res = Math.min(res, go(memo, table, delete));
//                delete = state.delete(table, i, 1);
//                if (delete != null) res = Math.min(res, go(memo, table, delete));
//            }
//            memo.put(state, res);
//            return res == Integer.MAX_VALUE ? 0 : res;
//        }
//
//        private static class State {
//            int[][] intervals;
//            int remainDays;
//
//            public State(State that) {
//                this(that.intervals, that.remainDays);
//            }
//
//            public State(int[][] intervals, int remainDays) {
//                this.remainDays = remainDays;
//                int n = intervals.length;
//                int m = intervals[0].length;
//                this.intervals = new int[n][m];
//                for (int i = 0; i < n; i++) {
//                    for (int j = 0; j < m; j++) {
//                        this.intervals[i][j] = intervals[i][j];
//                    }
//                }
//            }
//
//            private int calculateCost() {
//                int cost = 0;
//                for (int[] i : intervals) {
//                    int todayCost = i[1] < i[0] ? 0 : i[1] - i[0] + 1;
//                    cost += todayCost;
//                }
//                return cost;
//            }
//
//            private State delete(int[][][] table, int day, int side) { // side: 0 = left, 1 = right
//                if (this.intervals[day][0] == -1 || this.intervals[day][1] == -1) return null;
//                if (this.intervals[day][0] > this.intervals[day][1]) return null;
//                int prev = this.intervals[day][side];
//                State res = new State(this);
//                res.intervals[day][side] = table[day][prev][side];
//                res.remainDays--;
//                return res;
//            }
//
//            @Override
//            public int hashCode() {
//                return 31 * remainDays + Arrays.deepHashCode(intervals);
//            }
//
//            @Override
//            public boolean equals(Object obj) {
//                State that = (State) obj;
//                return Arrays.deepEquals(this.intervals, that.intervals) && this.remainDays == that.remainDays;
//            }
//        }
    }



    /**********************************************************************************************
     *                                           TEMPLATE                                         *
     **********************************************************************************************/
    public static void main(String[] args) throws IOException {
        PrintWriter out = null;
        Reader in;
        if (DEBUG) {
            for (String s : DEBUG_INPUT) {
                in = new Reader(new ByteArrayInputStream(s.getBytes()));
                out = new PrintWriter(System.out);
                out.println("===>>> INPUT");
                out.println(s + "\n\n");
                out.println("===>>> OUTPUT");
                long start = System.currentTimeMillis();
                new Solver().solve(in, out);
                long end = System.currentTimeMillis();
                out.println("\n");
                out.println("===========");
                out.println("Took: " + (end - start) + "ms");
                out.println("====================================================================");
                out.println();
                out.println();
                out.flush();
            }
        } else {
            in = new Reader(System.in);
            out = new PrintWriter(System.out);
            new Solver().solve(in, out);
        }
        if (out != null) out.flush();
    }

    /** Reader **/
    private static class Reader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public Reader(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        private String nextWord() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(reader.readLine());
            }
            return tokenizer.nextToken();
        }

        private int nextInt() throws IOException {
            return Integer.parseInt(nextWord());
        }

        private long nextLong() throws IOException {
            return Long.parseLong(nextWord());
        }

        private double nextDouble() throws IOException {
            return Double.parseDouble(nextWord());
        }
    }
}
