{"raw_statement":[{"iden":"problem statement","content":"You are given a grid of squares with $H$ horizontal rows and $W$ vertical columns, where each square is painted white or black. $HW$ characters from $A_{11}$ to $A_{HW}$ represent the colors of the squares. $A_{ij}$ is `#` if the square at the $i$\\-th row from the top and the $j$\\-th column from the left is black, and $A_{ij}$ is `.` if that square is white.\nWe will repeatedly perform the following operation until all the squares are black:\n\n*   Every white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed. The initial grid has at least one black square."},{"iden":"constraints","content":"*   $1 \\leq H,W \\leq 1000$\n*   $A_{ij}$ is `#` or `.`.\n*   The given grid has at least one black square."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$H$ $W$\n$A_{11}$$A_{12}$$...$$A_{1W}$\n$:$\n$A_{H1}$$A_{H2}$$...$$A_{HW}$"},{"iden":"sample input 1","content":"3 3\n...\n.#.\n..."},{"iden":"sample output 1","content":"2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black."},{"iden":"sample input 2","content":"6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#."},{"iden":"sample output 2","content":"3"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}