import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class string {
	public static void main(String [] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int testcases = Integer.parseInt(br.readLine());
		
		while(testcases-- >0 ) {
			
			int n = Integer.parseInt(br.readLine());
			String in = br.readLine();
			if(n == 1) {
				System.out.println(0);
				
			}
			else {
			int counter =0 ;
			for(int i = 0 ; i < n-1; i++) {
				if(in.charAt(i) == '<' && in.charAt(i+1) == '>') {
					counter++;
				}
			}
			System.out.println(counter);}
		}
	
	
	
	}
}