t = int(input())
for i in range(t):
    n = int(input())
    s = input()
    if s[0] == "<":
        tmp1 = 1
    else:
        tmp1 = 0

    if s[-1] == ">":
        tmp2 = 1
    else:
        tmp2 = 0
    print(max(tmp1+tmp2-1, 0))
