import java.util.Scanner;

import static java.lang.Math.min;

public class GoodString {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n =  in.nextInt();
        for(int i =0 ;i<n;i++){
            int size = in.nextInt();in.nextLine();
            String s = in.nextLine();
            int i1 = s.indexOf(">");
            int i2 = s.lastIndexOf("<");
            i2 = s.length()-1-i2;
            System.out.println(min(i1,i2));

        }
    }
}
