You have a string s of length n consisting of only characters > and <. You may do some operations with this string, for each operation you have to choose some character that still remains in the string. If you choose a character >, the character that comes right after it is deleted (if the character you chose was the last one, nothing happens). If you choose a character <, the character that comes right before it is deleted (if the character you chose was the first one, nothing happens).

For example, if we choose character > in string > > < >, the string will become to > > >. And if we choose character < in string > <, the string will become to <.

The string is good if there is a sequence of operations such that after performing it only one character will remain in the string. For example, the strings >, > > are good. 

Before applying the operations, you may remove any number of characters from the given string (possibly none, possibly up to n - 1, but not the whole string). You need to calculate the minimum number of characters to be deleted from string s so that it becomes good.

Input

The first line contains one integer t (1 ≤ t ≤ 100) – the number of test cases. Each test case is represented by two lines.

The first line of i-th test case contains one integer n (1 ≤ n ≤ 100) – the length of string s.

The second line of i-th test case contains string s, consisting of only characters > and <.

Output

For each test case print one line.

For i-th test case print the minimum number of characters to be deleted from string s so that it becomes good.

Example

Input


3
2
&lt;&gt;
3
&gt;&lt;&lt;
1
&gt;


Output


1
0
0

Note

In the first test case we can delete any character in string <>.

In the second test case we don't need to delete any characters. The string > < < is good, because we can perform the following sequence of operations: > < < → < < → <.
t = int(raw_input())

def remove_sequences(s):
    if len(s) == 0:
        return ''
    new_s = s[0]
    for i in xrange(len(s)):
        if s[i] != new_s[-1]:
            new_s += s[i]
    return new_s            

def smallest_op(s):
    c = list(s)

    ind = [0]
    for i in xrange(len(s) - 1):
        if c[i] == '>' and c[i + 1] == '<':
            ind.append(i)
    ind.append(len(s) - 1)

    l = 0
    r = len(s) - 1
    for x in xrange(1, len(ind)):
        curr = r - l
        if l == 0:
            curr += 1
        if ind[x] - ind[x - 1] < curr:
            r = ind[x]
            l = ind[x - 1]
    if l != 0:
        l += 1
    return s[l:r + 1]

def minor(s):
    c = list(s)
    return min(c.count('<'), c.count('>'))

for i in xrange(t):
    n = int(raw_input())
    s = raw_input()
    if s[0] == '>' or s[-1] == '<':
        print 0
    else:
        lt = 1
        while lt < len(s) and s[lt] == '<':
            lt += 1

        i = len(s) - 1
        while i > 0 and s[i] == '>':
            i -= 1
        bt = len(s) - i - 1
        print min(lt, bt)
        #so = smallest_op(s)
        #print minor(so)