
import java.util.*; 
import java.io.* ;

public class CF_1110 {

     public static void main(String[] args) {
        FastReader scn = new FastReader() ;
        int t = scn.nextInt() ;
        while(t-- > 0){
            int n = scn.nextInt() ;
            String s = scn.nextLine() ;
            Stack<Character> st = new Stack<>() ;
            int cnt = 0 ;
            for(int i = 0 ;i  < n ; i++){
                if(s.charAt(i) == '>' && !st.isEmpty() && st.peek() == '<'){
                    cnt++ ;
                    st.pop() ;
                } else {
                    st.push(s.charAt(i)) ;
                }
            }
            System.out.println(cnt);
        }
     }
     
     
     
     
     static class FastReader 
     { 
         BufferedReader br; 
         StringTokenizer st; 
   
         public FastReader() 
         { 
             br = new BufferedReader(new
                      InputStreamReader(System.in)); 
         } 
   
         String next() 
         { 
             while (st == null || !st.hasMoreElements()) 
             { 
                 try
                 { 
                     st = new StringTokenizer(br.readLine()); 
                 } 
                 catch (IOException  e) 
                 { 
                     e.printStackTrace(); 
                 } 
             } 
             return st.nextToken(); 
         } 
   
         int nextInt() 
         { 
             return Integer.parseInt(next()); 
         } 
   
         long nextLong() 
         { 
             return Long.parseLong(next()); 
         } 
   
         double nextDouble() 
         { 
             return Double.parseDouble(next()); 
         } 
   
         String nextLine() 
         { 
             String str = ""; 
             try
             { 
                 str = br.readLine(); 
             } 
             catch (IOException e) 
             { 
                 e.printStackTrace(); 
             } 
             return str; 
         } 
     } 
     
 }