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



import java.util.*;
import java.lang.*;
import java.lang.reflect.Array;
import java.io.*;
import java.math.*;
import java.util.HashMap;
import java.io.BufferedReader; 
import java.io.FileReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.StringTokenizer; 
import java.io.DataInputStream; 
import java.io.FileInputStream; 
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.BitSet;

public class Prac{   
    static int arr[]=new int[100000],j=0;
    static boolean isPrime(long a){
      long i=a/2;
      if(a==2)
          return true;
      while(i>1){
          if(a%i==0)
              return false;
          i--;
      }
      return true;
  }
    static void findPrimes(){
       
        for(int i=2;i<100000;i++){
            if(isPrime(i)){
                arr[j++]=i;
            }
        }
    }
    static class InputReader {
 
		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;
 
		public InputReader(InputStream st) {
			this.stream = st;
		}
 
		public int read() {
			if (snumChars == -1)
	 			throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
 
		public int ni() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
 
		public long nl() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
 
		public int[] nia(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = ni();
			}
			return a;
		}
 
		public String rs() {
			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 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 boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
 
		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
 
	}
    static PrintWriter w = new PrintWriter(System.out);
    public static void main(String[] args) throws IOException {   
        InputReader sc=new InputReader(System.in);
        
        int t=sc.ni();
        while(t-->0){
            int n=sc.ni();
            String s=sc.nextLine();
           // char arr[]=new char[n];
            ArrayList<Character> arr=new ArrayList<Character>();
           
            for(int i=0;i<n;i++){
                arr.add(s.charAt(i));
            }
            boolean found=false;
            int count=0,left=-1,right=n;
           for(int i=0;i<n;i++){
               if(s.charAt(i)=='>'){
                   left=i;
                   break;   
               }
           }
            for(int i=n-1;i>=0;i--){
               if(s.charAt(i)=='<'){
                   right=i;
                   break;   
               }
           }
            if(left!=-1&&right!=n){
                int ans=Math.min(left, n-right-1);
                w.println(ans);
            }
            else
                w.println(0);
          
//               for(int i=0;i<n;i++){
//                   
//                    if(arr.get(i)=='<'&&i>0&&arr.get(i-1)!='.'){
////                        int j=i-1;
////                        while(arr.get(j)=='.'){
////                            j--;   
////                            if(j<0)
////                                break;
////                        }
//                       // if(j>=0){
//                            arr.set(i-1,'.');
//                           
//                       // }
//                    }
//                    else if(arr.get(i)=='>'&&i<n-1&&arr.get(i+1)!='.'){
////                        int j=i+1;
////                        while(arr.get(j)=='.'){
////                            j++;
////                            if(j>n-1)
////                                break;
////                        }
////                        if(j<n){
//                            arr.set(i+1,'.');
//                            
//                        //}
//                    }
//                }
//               
//                
//            
//            
//            count=0;
//            for(int i=0;i<n;i++){
//                    if(arr.get(i)=='>'||arr.get(i)=='<')
//                        count++;
//                }
//             System.out.println(count-1);
        }
        
        
        w.close();
    }
}
