import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class B {
    public static void main(String[] args) throws IOException {
        BufferedReader reader= new BufferedReader(new InputStreamReader(System.in));

        int t = Integer.parseInt(reader.readLine());
        int count = 0;

        for(int i = 0; i < t; i++) {
            int n = Integer.parseInt(reader.readLine());
            String line = reader.readLine();
            if(n == 1)
                System.out.println(0);
            else if(line.equals("<>"))
                System.out.println(1);
            else {
                if(line.charAt(0) == '<')
                    count++;
                if(line.charAt(n - 1) == '>')
                    count++;
                System.out.println(count);
                count = 0;
            }
        }
    }
}
