queries = int(raw_input())

for i in range(queries):
    lenString = int(raw_input())
    string = raw_input()

    if(string[0] == '<' and string[lenString-1] == '>'):
        count = 0
        for j in range(lenString):
            if(string[j] == '<'):
                count +=1
        if((lenString - count) < count):
            print(lenString-count)
        else:
            print(count)
    else:
        print('0')