import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		
		Scanner sc = new Scanner(System.in);
		int a=sc.nextInt();
		while(a-->0) {
			int n=sc.nextInt();
			String t=sc.nextLine();
			t=sc.nextLine();
			int length = t.length();
			int ans=0;
			int arrL[]=new int[length];
			int arrR[]=new int[length];
			if(length==1) {
				System.out.println(0);
				continue;
			}
			int count=0;
			for(int i=1;i<length;i++) {
				if(t.charAt(i-1)=='<'||arrL[i-1]==1) {
					arrL[i]=1;
				}
			}
			for(int i=length-2;i>=0;i--) {
				if(t.charAt(i+1)=='>'||arrR[i+1]==1) {
					arrR[i]=1;
				}
			}
			int flag=0;
			for(int i=1;i<length-1;i++) {
				if(arrL[i]==0&&arrR[i]==0) {
					count++;
				}
			}
			if(arrR[0]==0) {
				count++;
			}
			if(arrL[length-1]==0) {
				count++;
			}
			
			System.out.println(count==0?0:(count-1));
		}
		
	}
}
