
t = int(input())
ans = []
for _ in range(t):

    n = int(input())
    s = input()
    i = 0
    count = 0
    while i<len(s)-1:
        if s[i] == '<':
            if s[i+1] == '>':
                count+=1
                i+=2
            else:
                i+=1

        elif s[i] == s[i+1]:
            i+=1
        else:
            i+=2

    ans.append(count)

print(*ans)







