A block of text is printed in a monospaced font. A small ball is placed on top of the first letter of the first line. Gravity pulls the ball down, and the page is tilted slightly to the right, so the ball also rolls to the right for as long as something holds it up.
When the square directly under the ball holds a character other than a space, the ball rolls one column to the right. When that square is a space, or lies past the end of the line, the ball falls straight down to the next line and then follows the same rule there. Once it falls off the last line, the ball leaves the text.
Columns are numbered from the left edge of each line, starting at column 1. Find the column the ball is in when it leaves the text.
The input holds several test cases. Each test case begins with a line containing one integer n (1≤n≤1000), the number of lines of text. The next n lines hold the text, made of printable ASCII characters and spaces. There are no tabs and no other unprintable characters. Each line is between 1 and 100 characters long, and the first line of every test case contains at least one character that is not a space. The input ends with a line containing a single 0.
For each test case, print one integer on its own line, the column from which the ball drops out of the text. Print no spaces, and do not separate the answers with blank lines.