Problem Statement  
The first mall of the kingdom is about to be inaugurated in a few days. The king wants to make sure that the mall is highly secured. The mall has N floors, numbered 1 to N. Each floor has stations which allow people to enter or leave the floor to which the station belongs. All escalators in the mall begin and end at stations of adjacent floors. To make movement of people easier, superescalators connect stations in floor 1 to stations in floor N. Each escalator or superescalator can be used to go upwards as well as downwards. If the ith floor has K_{i} stations then the stations are numbered from 1 to K_{i}. The escalators and superescalators are constructed in such a way that a person can reach any station from any other station using them. The king wants to have as many guards in the mall as possible to make it secure. Guards can only be placed at stations and at most 1 guard can be placed at a station. Moreover, the people of the kingdom become panicky if they see more than one guard at a time. Hence, there should be no such escalator (or superescalator) such that guards are placed at both its end stations. You are given a String[] escDescription which when concatenated represents a comma (',') separated list of escalators and superescalators. Every escalator (or superescalator) is of the form "A B C". If C is less than N, the String represents an escalator from station A of floor C, to station B of floor C+1. If C is equal to N, then the String represents a superescalator from station A of floor C (= N), to station B of floor 1. Help the king by returning the maximum number of guards he can place in the mall.  
Definition  
 
Constraints  
  N will be between 10 and 50, inclusive.  
  The total number of stations in the mall will not exceed 100.  
  escDescription will contain between 1 and 50 elements, inclusive.  
  Each element of escDescription will contain between 1 and 50 characters, inclusive.  
  The concatenation of the elements of escDescription will be a comma separated list of escalators and superescalators.  
  Each escalator and superescalator will be given as "A B C" (quotes for clarity), where A, B and C are positive integers with no leading zeros.  
  In each escalator and superescalator description, A will be a valid number of station located on floor C.  
  In each escalator and superescalator description, B will be a valid number of station located on floor C + 1 (or on floor 1, if C = N).  
  In each escalator and superescalator description, C will be between 1 and N, inclusive.  
  Each floor will have at least 1 station.  
  The stations on each floor will be numbered from 1 to K, inclusive, where K is the total number of stations on this floor.  
  Each pair of stations will be connected with at most one escalator or superescalator.  
  It will be possible to reach any station from any other station using escalators and superescalators.  
Examples  
0)  
 
1)  
 
2)  
