t = int(input())
for _ in range(t):
    n = int(input())
    s = input()
    count = 0
    for i in range(0, n):
        if s[i]!='>':
            count += 1
        else:
            break
    print(count)