t=int(input())
for _ in range(t):
    n=int(input())
    s=input()
    res=0
    if s[0]==">" or s[-1]=="<" or n==1:
        res=0
        print(res)
    else:
        s=[s[x] for x in range(n)]
        for i in range(n-1):
            if s[i]==">" and s[i+1]=="<":
                s[i+1]=">"
        print(s.count("<"))



        
        