t=int(input())
r=[None]*t
for i in range(0,t):
	n=int(input())
	l=input()
	j=0
	while j<n and l[j]!='>':
		j+=1
	if j==n or j==0:
		r[i]=0
	elif j<n:
		if j>=(n-1)/2:
			r[i]=n-j
		else:
			r[i]=j
for i in range(0,t):
	print(r[i])
