Peg Game
To a certain logic game "Peg" player jumps one chip through the other, after which those tokens, through which was to make a jump, removed from the board. The game lasts as long as there will be one piece. The playing field has a size of 7x7. The initial position of chips on the playing field is as follows:
ooo
ooo
ooooooo
ooo.ooo
ooooooo
ooo
ooo
A small letter 'o' corresponds to the chip, the point '.' corresponds to the empty field. A player may choose from one chip and one of the four directions (up, down, left, right), if in this direction on the adjacent field there is another chip and free field right behind her. Selected chip jumps over another chip and installed in the free field behind her. The chip, through which was to make a jump, removed from the board. Over the border the playing field can not go. Write a program that, given the current arrangement of chips determines the number of moves that can make a player from this position.
Input
The input file contains a description of the current position. The position is given seven lines, each containing exactly seven characters. The first two and last two characters of the first two and last two lines are always spaces. All other characters - or the point '.', Or a small Latin letter 'o'.
Output
Display single number - the number of moves. Conclusion number should be carried out with a line break.
Display single number - the number of moves. Conclusion number should be carried out with a line break.