
 
import java.math.*;

import java.util.*;
 
 
public class BruteForce {
 
    public static Scanner in =new Scanner(System.in);
    public static String getB(int n,int l){
        StringBuilder build=new StringBuilder();
             while(n>0){
            if(n%2==0)
                build.append(0);
            else
                build.append(1);
            n/=2;
        }
             if(build.toString().length()<l){
                 int dif=Math.abs(build.toString().length()-l);
                 for(int i=1;i<=dif;i++)
                     build.append("0");
             }
        return build.reverse().toString();
    }
    public static int bs(int[]z,int x){
        int ans=-1;
        int l=0;
        int r=z.length-1;
        while(l<=r&&r<z.length){
            
            int mid=l+(r-l)/2;
          
            if(z[mid]==x){
                ans=mid;
                break;
            }
            else if(z[mid]>x){
                r=mid-1;
            }
            else if(z[mid]<x){
                l=mid+1;
            }
        }
        return ans;
    }
    public static void main(String[] args){
        int T=in.nextInt();
        for(int t=0;t<T;t++){
            int n=in.nextInt();
            String s=in.next();
            char[]z=s.toCharArray();
            int count=0;
            for(int i=0;i<n-1;i++){
                char cur=z[i];
                char next=z[i+1];
                if(cur=='<'&&next=='>')
                    count++;
            }
            System.out.println(count);
        }
    }
}