P25884 [AtCoder] Counting Squares
普及-
题目描述

Problem Statement

There is a two-dimensional plane. For integers r and c between 1 and 9, there is a pawn at the coordinates (r,c) if the c-th character of S_{r} is #, and nothing if the c-th character of S_{r} is ..
Find the number of squares in this plane with pawns placed at all four vertices.

Input

The input is given from Standard Input in the following format:
S_1
S_2
$\vdots$
S_9

Output

Print the answer.

Constraints

  • Each of $S_1,\ldots,S_9$ is a string of length 9 consisting of # and ..

Sample Input 1

.......

.......

.........
.......#.
.....#...
........#
......#..
.........
.........

Sample Output 1

2

The square with vertices (1,1), (1,2), (2,2), and (2,1) have pawns placed at all four vertices.
The square with vertices (4,8), (5,6), (7,7), and (6,9) also have pawns placed at all four vertices.
Thus, the answer is 2.

Sample Input 2

.#.......

.#......

.#.......
.........
....#.#.#
.........
....#.#.#
........#
.........

Sample Output 2

3

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
##....... ##....... ......... .......#. .....#... ........# ......#.. ......... .........
样例输出
2