t = input()
o = []
c=0
k=0
for x in range(t):
    n = input()
    s = raw_input()
    if n>2:
        for y in range(1,n-2):
   	    if s[y]=='<' and s[y+1]!='<':
	        c+=1
	    if s[y]=='>' and s[y+1]!='>':
		k+=1
	if k>c:
	    c=k
    elif n==2:
	if s[0]!=s[1]:
	    c=1
    else:
	c=0
    o.append(c)
    c=0
for x in range(t):
    print o[x]
