def fn(A, n):
    if(A[0]=='>'): return False
    ss='<'
    flag = True
    for i in range(n):
        if(A[i]!=ss and flag):
            ss='>'
        elif(A[i]!=ss):
            return False
    return True

for _ in range(int(raw_input())):
    n = int(raw_input())
    s = raw_input()
    if(fn(s, n)):
        print min(s.count('<'), s.count('>'))
    else:
        print 0