Олимпиадный тренинг

Задача 44714. Unlucky sea battle


Today, Maxim was unlucky in    "Battleship". Playing with a neighbor on the desk, he never hit a single enemy ship. The game continued until Mar Ivanna saw that the guys were busy in the lesson with the wrong things.  The game had to end ahead of schedule with the victory of the neighbor. Having arrived home, Maxim decided to determine the maximum length of the enemy's ship. 
But now his mother distracted him and called him to dinner. He's gone out to dinner and asked you to help him find the answer. 

Sea battle is a game played on a 10 x 10 checkered field. Maxim managed to send you the field of the last game. On the field, cells are marked that Maxim has already shot. Ships of any size can be placed on the field, but the obligatory condition is that the ship be rectangular with width equal to 1. It is allowed to position the ship either horizontally or vertically.


Input

At input, the program receives 10 lines of 10 numbers each, the numbers are separated by spaces. The number 1 means that the corresponding cell was shot, the number 0 – that they didn't shoot at the cage.
(It is guaranteed that there is at least one unbeaten cell on the field.)


Output

Print the answer  – the maximum possible length of the ship.
 

Examples
# Input Output
1
0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 1 0
0 0 1 0 0 0 0 1 0 0
0 0 0 1 0 0 1 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0
0 0 1 0 0 0 0 1 0 0
0 1 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0
10