DWITE Contest

Test Case for Question #5 in DWITE 2007-2008 High School Round 1

Contest: DWITE 2007-2008 High School Round 1
Question: #5
Input File: DATA5.txt
Output File: OUT5.txt


Input

3
5
#####
VH..E
#####




Output

1