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: > < < → < < → <.

// Spaghetti code
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    static int mod=(int)(1e9+7);
    static int mod2=998244353;
    static PrintWriter pw;
    static class FastReader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); }public FastReader(InputStream is) { mIs = is;}
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];}
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;}
        public String next(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();}
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long res = 0; do{ if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read();}while(!isSpaceChar(c));return res * sgn;}
        public int i(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;}
        public double d() throws IOException {return Double.parseDouble(next()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
        public void scanIntArr(int [] arr){ for(int li=0;li<arr.length;++li)arr[li]=i();}
        public void printIntArr(int [] arr){ for(int li=0;li<arr.length;++li)pw.print(arr[li]+" ");pw.println();}
        public void printLongArr(long [] arr){ for(int li=0;li<arr.length;++li)pw.print(arr[li]+" ");pw.println();}
        public void scanIntIndexArr(int [] arr){ for(int li=0;li<arr.length;++li){ arr[li]=i()-1;}}
        public void scanLongArr(long [] arr){for (int i=0;i<arr.length;++i){arr[i]=l();}}
        public void shuffle(int [] arr){ for(int i=arr.length;i>0;--i) { int r=(int)(Math.random()*i); int temp=arr[i-1]; arr[i-1]=arr[r]; arr[r]=temp; } }
        public void shuffle(long [] arr){ for(int i=arr.length;i>0;--i) { int r=(int)(Math.random()*i); long temp=arr[i-1]; arr[i-1]=arr[r]; arr[r]=temp; } }
        public int swapIntegers(int a,int b){return a;} //Call it like this: a=swapIntegers(b,b=a)
        public int findMax(int [] arr){int res=Integer.MIN_VALUE;for(int num:arr)res=Math.max(res,num);return res;}
    }
    public static void main(String[] args) throws IOException {

        FastReader fr = new FastReader();
        pw = new PrintWriter(System.out);

     /*
inputCopy
3
2
<>
3
><<
1
>
outputCopy
1
0
0
  */
        //Press Ctrl+Win+Alt+L for reformatting indentation

        int t = fr.i();

        for (int ti = 0; ti < t; ++ti) {
            int n=fr.i();
            char [] str=fr.nextLine().toCharArray();
            int min=n;
            for(int i=0;i<n;++i)
                if(str[i]=='>')
                    min=Math.min(min,i+1);
                else
                    min=Math.min(min,n-i);
            pw.println(min-1);
        }
        pw.flush();
        pw.close();
    }
}