import java.util.*;
public class B1140 
{
	public static void main(String args[])
	{
		Scanner in=new Scanner (System.in);
		int t,l,i,ctr1,ctr2,c,exit,ans;
		t=in.nextInt();
		String s;
		char ch;
		while(--t>=0)
		{
			exit=0;
			ctr1=0;
			ctr2=0;
			c=1;
			l=in.nextInt();
			s=in.next();
			for(i=0;i<l;i++)
			{
				ch=s.charAt(i);
				if(ch=='<' && c==1)
				{
					ctr1++;
				}
				else if(ch=='>')
				{
					c=2;
					ctr2++;
				}
				else 
				{
					break;
				}
			}
			if(ctr1+ctr2==l)
				ans=Math.min(ctr1, ctr2);
			else
				ans=0;
			
			System.out.println(ans);
		}
	}
}
