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

public class GoodString{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine().trim());
        String result="";
        while(t>0){
            int n = Integer.parseInt(br.readLine().trim());
            String s = br.readLine().trim();
            int count=0;
            for(int i=0;i<n-1;i++){
                if(s.charAt(i)=='<' && s.charAt(i+1)=='>'){
                    count++;
                }
            }
            result+=count+"\n";
            t--;
        }
        System.out.println(result.trim());
    }
}