t = int(input())

for test in range(0,t):

    n = int(input())
    s = input()

    for i in range(1, n):

        if s == i*'<' + (n-i)*'>':
            print(min(i,n-i))
            break

    else:
        print(0)
