import java.util.*;

public class helloWorld 
{
	static int k1, k2, mod = 100000000;
	static int[][][][] dn;
	public static void main(String[] args) 
	{		
		Scanner in = new Scanner(System.in);
		int t = in.nextInt();
		
		StringBuilder ans = new StringBuilder();
		for(; t > 0; t--) {
			int n = in.nextInt();
			String str = in.next();
			int a = 0;
			if(str.charAt(0) == '<' && str.charAt(n-1) == '>')
				a++;
			ans.append(a + "\n");
		}
		
		System.out.println(ans);

		in.close();
	}
}

/*
><><><><><>
>
*/