Placeholder

#3889

Cow Art 1초 128MB

문제


입력

* Line 1: The integer N.

* Lines 2..1+N: Each line contains a string with N characters, describing one row of a painting.


출력

* Line 1: Two space-separated integers, telling the number of regions in the painting when viewed by a human and by a cow.


예제1

입력
5
RRRBB
GGBBB
BBBRR
BBRRR
RRRRR
출력
4 3

출처

USACO 2014 March Bronze


역링크 공식 문제집만

로그인해야 코드를 작성할 수 있어요.