import java.io.*;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Stack;
import java.util.StringTokenizer;

public class MainCF {

    public static void main(String[] args) throws Exception{

        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;

        InputReader in = new InputReader(inputStream);
        PrintWriter out= new PrintWriter(outputStream);

        Task solver = new Task();
        solver.solve(in,out);
        out.close();
    }

    static class Task{

        public void solve(InputReader in, PrintWriter out)
        {
            int t = in.nextInt();
            while(t-- > 0)
            {
                Stack<Character> stack = new Stack();
                int n = in.nextInt();
                String s = in.next();
                stack.push(s.charAt(0));
                int del = 0;
                for(int i = 1;i<n;i++)
                {
                    char ch = s.charAt(i);
                    if(ch == '>' && stack.peek()=='<')
                        del++;
                    stack.push(ch);
                }
                out.println(del);
            }
        }
    }

    static class InputReader{

        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream inputStream){

            reader = new BufferedReader(new InputStreamReader(inputStream));
            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 int nextInt()
        {
            return Integer.parseInt(next());
        }
    }
}