{"raw_statement":[{"iden":"problem statement","content":"We have a chocolate bar partitioned into $H$ horizontal rows and $W$ vertical columns of squares.\nThe square $(i, j)$ at the $i$\\-th row from the top and the $j$\\-th column from the left is dark if $S_{i,j}$ is `0`, and white if $S_{i,j}$ is `1`.\nWe will cut the bar some number of times to divide it into some number of blocks. In each cut, we cut the whole bar by a line running along some boundaries of squares from end to end of the bar.\nHow many times do we need to cut the bar so that every block after the cuts has $K$ or less white squares?"},{"iden":"constraints","content":"*   $1 \\leq H \\leq 10$\n*   $1 \\leq W \\leq 1000$\n*   $1 \\leq K \\leq H \\times W$\n*   $S_{i,j}$ is `0` or `1`."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$H$ $W$ $K$\n$S_{1,1}S_{1,2}...S_{1,W}$\n$:$\n$S_{H,1}S_{H,2}...S_{H,W}$"},{"iden":"sample input 1","content":"3 5 4\n11100\n10001\n00111"},{"iden":"sample output 1","content":"2\n\nFor example, cutting between the $1$\\-st and $2$\\-nd rows and between the $3$\\-rd and $4$\\-th columns - as shown in the figure to the left - works.\nNote that we cannot cut the bar in the ways shown in the two figures to the right.\n![image](https://img.atcoder.jp/ghi/ac90dd542639c04402125403b1c319d7.png)"},{"iden":"sample input 2","content":"3 5 8\n11100\n10001\n00111"},{"iden":"sample output 2","content":"0\n\nNo cut is needed."},{"iden":"sample input 3","content":"4 10 4\n1110010010\n1000101110\n0011101001\n1101000111"},{"iden":"sample output 3","content":"3"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}