import java.io.BufferedReader;
import java.io.InputStreamReader;

public class GoodString {
    public static void main (String [] args) throws Exception{
        BufferedReader bR = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(bR.readLine());
        while (t-- > 0) {
            int n = Integer.parseInt(bR.readLine()), min = n+1;
            String s = bR.readLine();
            for (int i = 0; i < n; i++) {
                if (s.charAt(i)=='>') {
                    min = Math.min(min,i);
                    break;
                }
            }
            for (int i = n-1; i >=0 ; i--) {
                if (s.charAt(i)=='<') {
                    min = Math.min(min,n+1-i);
                    break;
                }
            }
            System.out.println(min);
        }
    }
}