import java.util.Scanner;
public class Ishu
{
    public static void main(String[] args)
    {
        Scanner scan=new Scanner(System.in);
        int n,t,i,j;
        String str;
        int[] noc=new int[100];
        t=scan.nextInt();
        for(i=0;i<t;++i)
            {
                n=scan.nextInt();
                str=scan.next();
                if(n>1)
                    {
                        for(j=0;j<n-1;++j)
                            if(str.substring(j,j+2).equals("<>"))
                                {
                                    ++noc[i];
                                    break;
                                }
                    }
            }
        for(i=0;i<t;++i)
            System.out.println(noc[i]);
    }
}