import java.util.Scanner;

public class Main {
	public static void main(String...args) {
		Scanner in = new Scanner(System.in);
		
		int t = Integer.parseInt(in.next());
		while(t -- > 0) {
			int n = Integer.parseInt(in.next());
			String s = in.next();
			System.out.println(s.contains("<>") ? 1 : 0);
		}
	}
}

class Pair <T1, T2> {
	public T1 first;
	public T2 second;
	
	public Pair(T1 f, T2 s) {
		first = f;
		second = s;
	}
	
	@Override
	public String toString() {
		return first.toString() + " " + second.toString();
	}
}
