t=int(input())
for _ in range(t):
    n=int(input())
    s=input()
    a=0
    b=0
    for i in range( n):
        if s[i] != '>':
            a = a + 1
    for i in range(n - 1):
        if s[i] != '<':
            b = b + 1
    print(min(a, b))