t = int(input())

for _ in range(t):
    n = int(input())
    s = list(input())
    tem = s.count("<")
    if tem > n-tem:
        for i in range(1, n):
            if s[i] == "<":
                s[i-1] = ""
        s = list(filter(lambda x: x != "",s))
        print(len(s)-1)
    else:
        for i in range(n-1):
            if s[i] == ">":
                s[i+1] = ""
        s = list(filter(lambda x: x != "",s))
        print(len(s)-1)
