for i in range(int(input())):
	n = int(input())
	s = [i for i in input()]
	for i in range(n):
		if s[i]==">" and i!=n-1:
			s[i+1]==0
		elif s[i]=="<" and i!=0:
			s[i-1]=0
	print([0,s.count(0)+1][s.count(0)!=n-1])
	