Crossword Puzzle Words

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

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