시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 189 67 44 38.596%

문제

상근이는 정사각행렬에 0과 1을 쓰는 것을 좋아하는 아이이다. 오늘은 행렬에 플러스가 몇 개나 있는지 구해보려고 한다.

플러스는 변의 길이가 1보다 큰 홀수인 정사각형으로 가운데 행과 열은 1로, 나머지는 0으로 채워져 있다. 아래 행렬에는 플러스가 두 개 포함되어 있다.

00100 
00100 
11111 
00100 
00100 

행렬이 주어졌을 때, 플러스의 개수를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 행렬의 크기 N이 주어진다. (3 ≤ N ≤ 2000) 다음 N개 줄에는 행렬이 주어진다.

출력

입력으로 주어진 행렬에 포함된 플러스의 개수를 출력한다.

예제 입력 1

8
00010000
00010000
00010000
11111111
00010000
00010010
00010111
00010010

예제 출력 1

3
W3sicHJvYmxlbV9pZCI6IjMwOTUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQ1MGNcdWI3ZWNcdWMyYTRcdWM3NTggXHVhYzFjXHVjMjE4IiwiZGVzY3JpcHRpb24iOiI8cD5cdWMwYzFcdWFkZmNcdWM3NzRcdWIyOTQgXHVjODE1XHVjMGFjXHVhYzAxXHVkNTg5XHViODJjXHVjNWQwIDBcdWFjZmMgMVx1Yzc0NCBcdWM0ZjBcdWIyOTQgXHVhYzgzXHVjNzQ0IFx1Yzg4Ylx1YzU0NFx1ZDU1OFx1YjI5NCBcdWM1NDRcdWM3NzRcdWM3NzRcdWIyZTQuIFx1YzYyNFx1YjI5OFx1Yzc0MCBcdWQ1ODlcdWI4MmNcdWM1ZDAgXHVkNTBjXHViN2VjXHVjMmE0XHVhYzAwIFx1YmE4NyBcdWFjMWNcdWIwOTggXHVjNzg4XHViMjk0XHVjOWMwIFx1YWQ2Y1x1ZDU3NFx1YmNmNFx1YjgyNFx1YWNlMCBcdWQ1NWNcdWIyZTQuPFwvcD5cclxuXHJcbjxwPlx1ZDUwY1x1YjdlY1x1YzJh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