import java.util.*;
import java.lang.*;
import java.io.*;
public class A{

    public static void main(String[] args){
        InputStream inputStream = System.in;
        InputReader in = new InputReader(inputStream);
        int q = in.nextInt();
        while(q-->0){
            int n = in.nextInt();
            String s = in.next();
            int len = s.length();
            boolean flag;
            int count = 0;
            do{
                flag = false;
                for(int i=0;i<len-1;i++){
                    if(s.charAt(i)=='<' && s.charAt(i+1)=='>'){
                        count++;
                        flag = true;
                        s = s.substring(0,i)+s.substring(i+2,len);
                        len=len-2;
                    }
                }
            }while(flag);
            System.out.println(count);
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
    }
}
