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 \le t \le 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 \le n \le 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
<>
3
><<
1
>

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: > < < $\rightarrow$ < < $\rightarrow$ <.

Difficulty: interview

Starter code:

Solutions:
#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)

isdebug = False
try :
    #raise ModuleNotFoundError
    import pylint
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
    isdebug = True
except Exception:
    def dprint(*args, **kwargs):
        pass


def red_inout():
    inId = 0
    outId = 0
    if not isdebug:
        inId = 0
        outId = 0
    if inId>0:
        dprint('use input', inId)
        try:
            f = open('input'+ str(inId) + '.txt', 'r')
            sys.stdin = f #标准输出重定向至文件
        except Exception:
            dprint('invalid input file')
    if outId>0:
        dprint('use output', outId)
        try:
            f = open('stdout'+ str(outId) + '.txt', 'w')
            sys.stdout = f #标准输出重定向至文件
        except Exception:
            dprint('invalid output file')
            
        atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit

if isdebug and len(sys.argv) == 1:
    red_inout()

def getIntList():
    return list(map(int, input().split()))            

def solve(): 
    pass
    
T_ = 1    
T_, = getIntList()

for iii_ in range(T_):
    #solve()
    N,  = getIntList()
    #print(N)
    s = input()
    r = 0
    for i in range(N):
        if s[i] =='>':
            r = i
            break
    r1 = 0
    for i in range(N-1, -1, -1):
        if s[i]=='<':
            r1 = N-1-i
            break
    print(min(r,r1))


ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())

for _ in range(ii()):
    n = ii()
    s = input().strip()
    c1 = c2 = 0
    for c in s:
        if c == '<':
            c1 += 1
        else:
            break
    for c in s[::-1]:
        if c == '>':
            c2 += 1
        else:
            break
    print(min(c1, c2))

t = int(input())
for _ in range(t):
    input()
    s = input()
    pref_len = 0
    for c in s:
        if c != '<':
            break
        pref_len += 1
    suf_len = 0
    for c in reversed(s):
        if c != '>':
            break
        suf_len += 1
    print(min(suf_len, pref_len))


t = int(input())
for i in range(t):
    n = int(input())
    s = input()
    a, b = 999999999, 9999999999
    if '>' in s:
        a = s.index('>')
    if '<' in s:
        b = n - 1 - s.rindex('<')
    print(min(a, b))


for i in range(int(input())):
    x = int(input())
    y = input()
    print(min(y.index(">")if ">"in y else 10000000, y[::-1].index("<") if "<" in y else 100000000))

t = int(input())
for i in range(t):
    n = int(input())
    s = input()
    num = s.find(">")
    num2 = s.rfind("<")
    if num == -1 or num2 == -1:
        print(0)
    else:
        print(min(num,n - 1 - num2))


t=int(input())
for _ in range(t):
         n=int(input())
         s=input()
         ans1=n
         ans2=n
         for i in range(n):
                  if(s[i]=='>'):
                           ans1=i
                           break
         for i in range(n):
                  if(s[i]=='<'):
                           ans2=n-i-1
         print(min(ans1,ans2))

Q = int(input())

for _ in range(Q):
    N = int(input())
    s = input()
    mi = N - 1
    for i in range(N):
        if s[i] == ">":
            mi = i
            break
    for i in range(N):
        if s[N-1-i] == "<":
            mi = min(mi, i)
            break

    print(mi)


# stdin=open('input.txt')

# def input():
# 	return stdin.readline()[:-1]

# a, b = map(int, input().split())

# l = list(map(int, input().split()))


# CODE BEGINS HERE.................

for t in range(int(input())):
	n = int(input())
	a = input()

	count1 = 0
	count2 = 0
	for i in a:
		if i == '<':
			count1 += 1
		else:
			break

	a = a[::-1]

	for i in a:
		if i == '>':
			count2 += 1
		else:
			break

	print(min(count1, count2))

#CODE ENDS HERE....................




rs = lambda : int(input())
ri = lambda : map(int, input().split())
rli = lambda : list(map(int, input().split()))

n = int(input())
for i in range(n):
    k = int(input())
    s = input()
    ans = k-1
    ans1 = 0
    while ans1 < k and s[ans1] == '<':
        ans1+=1
    ans2 = 0
    while k-1-ans2 >= 0 and s[k-1-ans2] == '>':
        ans2+=1
    ans = min([ans, ans2, ans1])
    print(ans)

for _ in range(int(input())):
    n = int(input())
    s = input()
    k = 0
    for i in range(n-1,-1,-1):
        if s[i] is '<':
            k = n-1-i
            break
    
    for i in range(n):
        if s[i] is '>':
            k = min(k,i)
            break
    print(k)

from collections import defaultdict as dd
import math
def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return list(map(int, input().split()))

def lm():
	return list(map(int, input().split()))






n=nn()

for i in range(n):
	l=nn()

	s=li()

	leftmin=0
	rightmin=0

	
	
	while leftmin<len(s) and s[leftmin]=='<':
		leftmin+=1

	while rightmin<len(s) and s[~rightmin]=='>':
		rightmin+=1

	print(min(leftmin,rightmin))




for _ in range(int(input())):
    n = int(input())
    s = input()
    ans = 0
    
    for i in range(n):
        if s[i] is '>':
            ans = i
            break
    
    
    
    for i in range(n-1,-1,-1):
        if s[i] is '<':
            ans = min(n-1-i,ans)
            break
    
    print(ans)

t = int(input())
for _ in range(t):
    input()
    s = input()
    cl = 0
    for c in s:
        if c == '>':
            break
        cl += 1
    cr = 0
    for c in s[::-1]:
        if c == '<':
            break
        cr += 1
    print(min(cl,cr))


t = int(input())

for _ in range(t):
    n = int(input())
    s = input()
    if ">" in s:
        left = s.index(">")
    else:
        left = n+1
    if "<" in s:
        right = s[::-1].index("<")
    else:
        right = n+1
    print (min(left,right))

t = int(input())

for test in range(0,t):

    n = int(input())
    s = input()

    prefix_len=0
    suffix_len=0

    for i in range(0,n):

        ##print(i)

        if s[i]=='<':
            prefix_len+=1

        else:
            break

    for i in range(n-1,-1,-1):

        ##print(i)

        if s[i]=='>':
            suffix_len+=1

        else:
            break

    print(min(suffix_len,prefix_len))


t = int(input())
for i in range(t):
    n =int(input())
    s=input()
    if s[0] == '>' or s[-1]=='<':
        print(0)
    else:
        q=0
        w=0
        for j in s:
            if j=='<':
                q+=1
            else:
                break
        for j in range(len(s)-1, -1, -1):
            if s[j]=='>':
                w+=1
            else:
                break
        print(min(q, w))


t=int(input())
while t:
	t-=1
	n=int(input())
	s=input()
	l=0
	while l<n and s[l]!='>':
		l+=1
	r=n-1
	while r>=0 and s[r]!='<':
		r-=1
	print(min(min(l,n-1-r),n-1))

for t in range(int(input())):
	n = int(input())
	wo = input().strip()
	ii, jj = 0, 0
	i, j = 0, n-1
	while i < n and wo[i] == '<':
		ii += 1
		i += 1
	while j >= 0 and wo[j] == '>':
		j-=1
		jj += 1
	print(min(ii, jj))


def solve():
    n=int(input())
    s=input()
    if s.count('<')==0:
        return 0
    if s.count('>')==0:
        return 0
    if s[0] == '>':
        return 0
    if s[-1] == '<':
        return 0
    s1=0
    s2=0
    for i in range(n):
        if s[i]=='<':
            s1+=1
        else:
            break
    for i in range(n-1,-1,-1):
        if s[i]=='>':
            s2+=1
        else:
            break
    return min(s1,s2)

t=int(input())
for i in range(t):
    print(solve())


from collections import defaultdict
from functools import reduce

mi = lambda: [int(i) for i in input().split()]
flat = lambda l: reduce(lambda a, b: a + b, l)

t = mi()[0]

for _ in range(t):
    n = mi()[0]
    s = input()

    # print(min(s.find('>'), (len(s) - s.rfind('<') - 1)))
    print(min(len(s) - len(s.lstrip('<')), len(s) - len(s.rstrip('>'))))


n = int(input())
for i in range(n):
    m = int(input())
    s = input()
    num1 = 0
    num2 = 0
    j1 = 0
    j2 = m - 1
    while j1 < m and s[j1] == '<':
        num1 += 1
        j1 += 1
    while j2 >= 0 and s[j2] == '>':
        num2 += 1
        j2 -= 1
    print(min(num1, num2))

for _ in range(int(input())):
    n=int(input())
    s=list(input())
    x,y=-1,-1
    for i in range(n):
        if s[i]=='>':
            x=i
            break
    for i in range(n-1,-1,-1):
        if s[i]=='<':
            y=n-1-i
            break
    if x==-1 or y==-1:
        print(0)
    else:
        print(min(x,y))