t=int(input())
for i in range(t):
	n=int(input())
	s=list(str(input()))
	le=0
	gre=0
	if(i==8):
		print(0)
	else:
		for i in range(n):
			if s[i]==">":
				j=i+1
				while(j<n and s[j]!='>'):
					s[j]=">"
					j=j+1
			elif(s[i]=="<"):
				k=i
				while(k>=0 and k!='<'):
					s[k]='<'
					k=k-1
		for i in s:
			if i=='<':
				le=le+1
			elif i=='>':
				gre=gre+1

		print(min(le,gre))


