F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

XieGang and FanXieGang

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 467    Accepted Submission(s): 164


Problem Description
  As we know, ¡®/¡¯ in chinese is ¡°Xie Gang¡±, and ¡®\¡¯ is ¡°Fan Xie Gang¡±, we can use them to build a beautiful labyrinth, for example :

here ¡®/¡¯ and ¡®\¡¯ in the labyrinth means walls, the wall which can¡¯t separate two rooms we call it ¡°inner wall¡±, for example, in he figure below, there are three ¡°inner wall¡±s.

 

Input
  There are no more than 20000 cases. each case contains two integers n and m£¨n,m<=500£©, the width and the height of the labyrinth, The next m lines represent the labyrinth itself, and contain n characters each, all these characters will be "/" or "\".
 

Output
  Output one integer represents the number of ¡°inner wall¡±.
 

Sample Input
3 3 \/\ /\\ /\/ 4 4 //// \\\\ //// \\\\
 

Sample Output
2 0
 

Author
WhereIsHeroFrom
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-12 09:07:03, Gzip enabled