把平面划分成若干区域。现在要拆除若干段篱笆，使平面连通。输出最少拆除的篱笆段数。1 ≤ N ≤ 1000
The first line of input contains N(1≤N≤1000). The next line contains a string of length N
describing FJ's path. Each character is either N (north), E (east), S (south), or W (west).
Write out a single integer giving the minimum number of gates FJ needs to build to restore complete connectivity to all regions of his farm. Note that the answer could be zero if the farm is connected to begin with.