t=int(input())
for k in range(t):
    cnt1=cnt2=0
    i=0
    flag=True
    j=int(input())
    n=list(input())
    for item in n:
        if item=='<':
            cnt1+=1
        else:
            start=i
            break
        i+=1
    for i in range(start,len(n)):
        if n[i]=='<':
            flag=False
        else:
            cnt2+=1
    if flag:
        print(min(cnt1,cnt2))
  
    else:
        print(0)
