import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int val(char c) { if(c == 'U') return 1; else return -1; } public static void main(String[] args) throws Exception { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); String path = br.readLine(); boolean start=false; boolean end = false; int count = 0; int tour = 0; for(int i=0;i