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.*;
import java.text.*;
import java.lang.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.regex.*;
import java.util.stream.LongStream;

public class Myclass{
         public static ArrayList adj[]=new ArrayList[3000001];
         
         public static void main(String[] args) throws FileNotFoundException 
        {
            InputReader in=new InputReader(System.in);
            PrintWriter pw = new PrintWriter(System.out);
            int n=in.nextInt();
            int m=in.nextInt();
            int k=in.nextInt();
            char a[][]=new char [n][m];
            for(int i=0;i<n;i++) {
            	adj[i]=new ArrayList<Integer>();
            	a[i]=in.nextLine().toCharArray();
            }
            int tot=0;
            int one[]=new int[n];
            int range[]=new int[n];
            long ans=0L;
            for(int i=0;i<n;i++) {
            	int mini=Integer.MAX_VALUE;
            	int maxi=Integer.MIN_VALUE;
            	for(int j=0;j<m;j++) {
            		if(a[i][j]=='1') {
            			one[i]++;
            			mini=Math.min(j, mini);
            			maxi=Math.max(maxi, j);
            			adj[i].add(j);
            		}
            	}
            	tot+=one[i];
            	if(one[i]>0) {
            		range[i]=maxi-mini+1;
            		ans+=maxi-mini+1;
            	}
            }
            if(tot<=k) {
            	pw.println(0);
            	pw.flush();
            	pw.close();
            	System.exit(0);
            }
            int t=Math.max(k, m)+1;
            long pre[][]=new long[n][t];
            long back[][]=new long[n][t];
            long fi[][]=new long[n][t];
            long dp[][]=new long[n+1][k+1];
            for(int i=0;i<n;i++) {
            	if(adj[i].size()==0)
            		continue;
            	if(adj[i].size()==1) {
            		back[i][1]=pre[i][1]=1;
            		continue;
            	}
            	for(int j=1;j<adj[i].size();j++) {
            		int id=(int) adj[i].get(j);
            		pre[i][j]=(id-(int)adj[i].get(0));
            	}
            	for(int j=adj[i].size()-2;j>=0;j--) {
            		int id=(int) adj[i].get(j);
            		back[i][adj[i].size()-1-j]=((int) adj[i].get(one[i]-1)-id);
            	}
            	for(int j=adj[i].size();j<=k && adj[i].size()>1;j++) {
            		pre[i][j]=back[i][j]=(int) adj[i].get(one[i]-1)-(int)adj[i].get(0)+1;
            	}
            }
            for(int i=0;i<n;i++) {
            	for(int j=0;j<=k;j++) {
        			fi[i][j]=Math.max(back[i][j], pre[i][j]);
            		for(int l=0;l<=j;l++) {
            			fi[i][j]=Math.min(range[i],Math.max(fi[i][j],pre[i][l]+back[i][j-l]));
            		}
            	}
            }
            for(int i=1;i<=n;i++) {
            	for(int j=0;j<=k;j++) {
            		dp[i][j]=dp[i-1][j];
            		for(int l=0;l<=j;l++) {
            			dp[i][j]=Math.max(dp[i][j],fi[i-1][l]+dp[i-1][j-l] );
            		}
            	}
            }
            pw.println(ans-dp[n][k]);
            pw.flush();
            pw.close();
        
        
        }
         private static void debug(Object... o) {
             System.out.println(Arrays.deepToString(o));
         }
        static class InputReader 
        {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;
 
        public InputReader(InputStream stream) 
        { 
            this.stream = stream;
        }
        public int snext() 
        {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) 
            {
                curChar = 0;
                try 
                {
                    snumChars = stream.read(buf);
                } 
                
                catch (IOException e) 
                {
                    throw new InputMismatchException();
                }
                
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int nextInt() 
        {
            int c = snext();
            while (isSpaceChar(c)) 
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do 
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public long nextLong()
        {
            int c = snext();
            while (isSpaceChar(c)) 
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') 
            {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do 
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public int[] nextIntArray(int n) 
        {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) 
            {
                a[i] = nextInt();
            }
            return a;
        }
        static class tri implements Comparable<tri> {
            int p, c, l;
 
            tri(int p, int c, int l) {
                this.p = p;
                this.c = c;
                this.l = l;
            }
 
            public int compareTo(tri o) {
                return Integer.compare(l, o.l);
            }
        }
 
        public String readString()
        {
            int c = snext();
            while (isSpaceChar(c)) 
            {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do 
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        public String nextLine() 
        {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do 
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }
 
        public boolean isSpaceChar(int c) 
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        private boolean isEndOfLine(int c) 
        {
            return c == '\n' || c == '\r' || c == -1;
        }
 
        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }
        public static long mod = 1000000007;
        public static int d;
        public static int p;
        public static int q;
        
        public static int[] suffle(int[] a,Random gen)
        {
            int n = a.length;
            for(int i=0;i<n;i++)
            {
                int ind = gen.nextInt(n-i)+i;
                int temp = a[ind];
                a[ind] = a[i];
                a[i] = temp;
            }
            return a;
        }
        
        public static void swap(int a, int b){
            int temp = a;
            a = b;
            b = temp;
        }
        
       /* public static long primeFactorization(long n)
        {
             HashSet<Integer> a =new HashSet<Integer>();
            long cnt=0;
            for(int i=2;i*i<=n;i++)
            {
                while(a%i==0)
                {
                    a.add(i);
                    a/=i;
                }
            }
            if(a!=1)
                cnt++;
                //a.add(n);
            return cnt;
        }*/
        
        public static void sieve(boolean[] isPrime,int n)
        {
            for(int i=1;i<n;i++)
                isPrime[i] = true;
            
            isPrime[0] = false;
            isPrime[1] = false;
            
            for(int i=2;i*i<n;i++)
            {
                if(isPrime[i] == true)
                {
                    for(int j=(2*i);j<n;j+=i)
                        isPrime[j] = false;
                }
            }
        }
        
        public static int GCD(int a,int b)
        {
            if(b==0)
                return a;
            else
                return GCD(b,a%b);
        }
        
        public static long GCD(long a,long b)
        {
            if(b==0)
                return a;
            else
                return GCD(b,a%b);
        }
        
        public static void extendedEuclid(int A,int B)
        {
            if(B==0)
            {
                d = A;
                p = 1 ;
                q = 0;
            }
            else
            {
                extendedEuclid(B, A%B);
                int temp = p;
                p = q;
                q = temp - (A/B)*q;
            }
        }
        
        public static long LCM(long a,long b)
        {
            return (a*b)/GCD(a,b);
        }
        
        public static int LCM(int a,int b)
        {
            return (a*b)/GCD(a,b);
        }
        
        public static int binaryExponentiation(int x,int n)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }
        
        public static long binaryExponentiation(long x,long n)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }
        
        public static int modularExponentiation(int x,int n,int M)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result * x)%M;
                x=(x%M*x)%M;
                n=n/2;
            }
            return result;
        }
        
        public static long modularExponentiation(long x,long n,long M)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result%M * x%M)%M;
                x=(x%M * x%M)%M;
                n=n/2;
            }
            return result;
        }
        
        public static long modInverse(int A,int M)
        {
            return modularExponentiation(A,M-2,M);
        }
        
        public static long modInverse(long A,long M)
        {
            return modularExponentiation(A,M-2,M);
        }
        
        public static boolean isPrime(int n)
        {
            
            if (n <= 1)  return false;
            if (n <= 3)  return true;
            
            if (n%2 == 0 || n%3 == 0) 
                return false;
         
            for (int i=5; i*i<=n; i=i+6)
            {
                if (n%i == 0 || n%(i+2) == 0)
                   return false;
            }
            
            return true;
        }
        
         public static long[] shuffle(long[] a, Random gen){ 
                for(int i = 0, n = a.length;i < n;i++){ 
                    int ind = gen.nextInt(n-i)+i; 
                    long d = a[i]; 
                    a[i] = a[ind]; 
                    a[ind] = d; 
                } 
                return a; 
            }
         static class pair implements Comparable<pair>{
             Long x;
             Integer y;
             pair(long x,int  y){
                 this.x=x;
                 this.y=y;
             }
              public int compareTo(pair o) {
                     int result = x.compareTo(o.x);
                     if(result==0)
                         result = y.compareTo(o.y);
                     
                 return result;
                 }  
              public String toString(){
                 return (x+" "+y);
             }
       }       
 
      
}
