import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int a=in.nextInt();
		while(a!=0)
		{
			a--;
			int b=in.nextInt();
			String s=in.next();
			char[] c=new char[100];
			c=s.toCharArray();
			if(b==1)
			{
				System.out.println("0");
				continue;
			}
			int d=0;
			int e=0;
			for(int i=0;i<c.length;i++)
			{
				if(c[i]=='<')
				{
					d++;
				}
			}
			for(int i=c.length-1;i>0;i--)
			{
				if(c[i]=='>')
				{
					e++;
				}
			}
			int min=d<e?d:e;
			System.out.println(min);
		}
	}
}
  	 	   	 			      	 	 		   		