시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB0000.000%

문제

Consider a cross puzzle (where '-' represents a blank and '#' represents a black square):

- - - - #
- - # # -
- - - - -
- # # - -
# - - - -

A word must be at least two characters in length and contiguous as per traditional crossword puzzle rules. In this example, there are five 'across' words and four 'down' words.

Your job is to read in a crossword puzzle and compute the number of words across and down.

입력

  • Line 1: A single integer N, 3 ≤ N ≤ 100, the dimension of the square puzzle
  • Lines 2..N+1: N characters, each either '-' or '#' representing the puzzle

출력

  • The output is a single line that contains two integers:
    • the number of 'across' words
    • the number of 'down' words

예제 입력 1

5
----#
--##-
-----
-##--
#----

예제 출력 1

5
4