import java.util.*;

public class GoodString{
	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);
		int t = input.nextInt();
		while(t>0)
		{
		    t--;
		    int n = input.nextInt();
		    String str = input.next();
		    int a =1;
		    int count=0;
		    while(a==1)
		    {
		        if(n==3 && str.contains("<>>"))
		        {
		            int index = str.indexOf("<>>");
		            count+=1;
		            StringBuilder sb = new StringBuilder(str);
		            sb.deleteCharAt(index);
		            str = sb.toString();
		        }
		        else if(n==3 && str.contains("<<>"))
		        {
		            int index = str.indexOf("<>>");
		            count+=1;
		            StringBuilder sb = new StringBuilder(str);
		            sb.deleteCharAt(index+2);
		            str = sb.toString();
		        }
		        else if(n==2 && str.contains("<>"))
		        {
		            count+=1;
		            break;
		        }
		        else if(str.contains("<<>>"))
		        {
		            int index = str.indexOf("<<>>");
		            count+=1;
		            StringBuilder sb = new StringBuilder(str);
		            sb.deleteCharAt(index+1);
		            str = sb.toString();
		        }
		        else a=0;
		    }
		    System.out.println(count);
		}
		
	}
}