import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class solution 
{
 
  public static void main(String[] args) throws IOException
  { BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  int t=Integer.parseInt(br.readLine());
   for(int itr=0;itr<t;itr++)
    { 
      String w=br.readLine();
        int n=Integer.parseInt(w);
     String s=br.readLine();
     char[] sr=s.toCharArray();   
     int counta=0;
     int countb=0;
     int result = 0;

      for(int i=0;i<n;i++)
      {
        if(sr[i]=='<')
           counta++;
         else
          countb++;
      }
      if(counta==0)
         System.out.println("0");
      else if(countb==0)
         System.out.println("0");
       else
       {
        if(counta>countb)
        {
          // result=countb;
          for(int i=1;i<n;i++)
          {
             if(sr[i]=='<'&&sr[i-1]=='>')
               sr[i-1]='0';

          }
          for(int j=0;j<n;j++)
             {
              if(sr[j]=='0')
                 result++;
             }
             System.out.println(countb-result);
        }
        else
        {
           for(int i=0;i<n-1;i++)
          {
             if(sr[i]=='>'&&sr[i+1]=='<')
               sr[i+1]='0';

          }
          for(int j=0;j<n;j++)
             {
              if(sr[j]=='0')
                 result++;
             }
             System.out.println(counta-result);
        }
       }
    
    }
    // sc.close();
    }
}