for _ in range(int(input())):
    n=int(input())
    s=str(input())
    l=list(s)
    l1=[]
    for i in range(n):
        if(l[i]==">" and i==n-1):
            l1.append(">")
        if(l[i]=="<" and i==0):
            l1.append("<")
    if(l1.count("<")==0 or l1.count(">")==0):
        print(0)
    else:
        print(min(l1.count("<"),l1.count(">")))
