import java.util.Scanner;

public class main {
    public static void main(String agrs[]){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        int[] len = new int[t];
        String[] lines = new String[t];
        for (int i = 0; i < t; i++){
            len[i] = sc.nextInt();
            lines[i] = sc.next();
        }
        boolean first_move;
        char buffer;
        char previous_buffer;
        int buf_res;
        for(int i = 0; i < t; i++){
            buf_res  = 0;
            if (len[i] > 1) {
                for (int a = 1; a < len[i]; a++) {
                /*if(first_move){
                    previous_buffer = lines[i].charAt(a);
                    first_move = false;
                    continue;
                }*/
                    previous_buffer = lines[i].charAt(a - 1);
                    buffer = lines[i].charAt(a);
                    if (previous_buffer == '<' & buffer == '>') buf_res++;
                }
            }
            len[i] = buf_res;
        }

        for(int i = 0; i < t; i++) System.out.println(len[i]);
    }
}
