import java.util.Scanner;

public class GoodString {
	static int numOfOps(String str) {
		int right = 0, left = 0, rightPointer = str.length() - 1;
		for(int i = 0; i < str.length(); i++, rightPointer--) {
			if(str.charAt(i) == '>') {
				if(i == str.length() - 1 || str.charAt(i + 1) != '<')
					right++;
			}
			if(str.charAt(rightPointer) == '<') {
				if(rightPointer == 0 || str.charAt(rightPointer - 1) != '>')
					left++;
			}
		}
		return left > right? right : left;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i = 0; i < n; i++) {
			sc.nextInt();
			sc.nextLine();
			System.out.println(numOfOps(sc.nextLine()));	
		}
		sc.close();
	}
}
