Q = int(input())
for _ in range(Q):
    n = int(input())
    s = input()
    if s[0] == '>' or s[-1] == '<':
        print(0)
    else:
        ans = 1000
        for i, v in enumerate(s):
            if v == '>':
                break
        ans = i
        for i, v in enumerate(s[::-1]):
            if v == '<':
                break
        ans = min(ans, i)
        print(i)