n = int(input())
ans,ans1 = 0,0
for i in range(n):
    j = int(input())
    l = list(input())
    if l[0] == ">" or l[-1] == "<":
        print(0)
    else:
        for i in range(j):
            if l[i] == ">":
                ans += 1
            else:
                ans1 += 1
        print(min(ans,ans1))
        ans=0
        ans1=0