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.util.*;
		import javax.swing.plaf.synth.SynthSpinnerUI;
		import javax.swing.plaf.synth.SynthStyle;
		import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
		import java.util.StringTokenizer;
		import java.io.BufferedReader;
		import java.io.IOException;
		import java.io.InputStreamReader;
		
		public class mohamedy23
				{
			//to order according region and score
		public static	class Pair implements Comparable<Pair> {
		  		int reg, score;String s;
		   
		  		public Pair(int reg, int score,String s) {
		  			this.reg = reg;
		  			this.score = score;
		  			this.s=s;
		  		}
		   
		  		public int compareTo(Pair A) {
		  			if(reg==A.reg)return A.score-score;
		  			return reg-A.reg;
		  		}
		  		public String toString() {
		  			return reg+" "+score+" "+s;
		  		}
		   
		  		
		  	}
				public static void main (String args[])throws NumberFormatException, IOException, InterruptedException
				    {
				    	Scanner sc=new Scanner(System.in);
				        int n=sc.nextInt();int f=0;int f2=0;
				    	for(int i=0;i<n;i++) {
				    		int x=sc.nextInt();String s=sc.next();f=0;f2=0;
				    		
				    			for(int j=s.length()-1;j>=0;j--) {
				    				if(s.charAt(j)=='<')break;
				    				else f++;
				    			}for(int k=0;k<s.length();k++) {
				    				if(s.charAt(k)=='>')break;
				    				else f2++;
				    			}
				    			System.out.println(Math.min(f,f2));
				    		}
				    	
				    	
				    	


				    
				    }  	
//				    	System.out.println(Arrays.toString(a));
//				    	System.out.println(Arrays.toString(b));
				    	
				    
			      static int binarySearch(int a[],int x) {
			    	  int l=0;int h=a.length-1;int mid =(l+h)/2;
			    	  
			    		l=0;h=a.length-1;  mid=(l+h)/2;
			    		  for( ;l<=h;) {mid=(l+h)/2;
			    		  if(x==a[mid])return mid;
			    		  else if(x>a[mid])l=mid+1;
			    		  else  h=mid-1;
			    	  
			    	  }
			    	  return -1;
			      }
			      
			   
			      
			      
			      
			      




				//	Bubble Sort    
			      static void bubbleSort(int a[]) 
			      { 
			          int n = a.length; 
			          for (int i = 0; i < n-1; i++) 
			              for (int j = 0; j < n-i-1; j++) 
			                  if (a[j] > a[j+1]) 
			                  { 
			                      // swap arr[j+1] and arr[i] 
			                      int temp = a[j]; 
			                      a[j] = a[j+1]; 
			                      a[j+1] = temp; 
			                  } 
			      }      
			    //Merge Sort
			      
			      	public static void mergeSort(int[] a, int n) {
			      	    if (n < 2) {
			      	        return;
			      	    }
			      	    int mid = n / 2;
			      	    int[] l = new int[mid];
			      	    int[] r = new int[n - mid];
			      	 
			      	    for (int i = 0; i < mid; i++) {
			      	        l[i] = a[i];
			      	    }
			      	    for (int i = mid; i < n; i++) {
			      	        r[i - mid] = a[i];
			      	    }
			      	    mergeSort(l, mid);
			      	    mergeSort(r, n - mid);
			      	 
			      	    merge(a, l, r, mid, n - mid);
			      	}
			      	
			      	public static void merge(
			      			  int[] a, int[] l, int[] r, int left, int right) {
			      			  
			      			    int i = 0, j = 0, k = 0;
			      			    while (i < left && j < right) {
			      			        if (l[i] <= r[j]) {
			      			            a[k++] = l[i++];
			      			        }
			      			        else {
			      			            a[k++] = r[j++];
			      			        }
			      			    }
			      			    while (i < left) {
			      			        a[k++] = l[i++];
			      			    }
			      			    while (j < right) {
			      			        a[k++] = r[j++];
			      			    }
			      			}
			      //Comparable Class to sort 2d array[n][2] according the first column
			    	
			      
			      static class Scanner {
				  		StringTokenizer st;
				  		BufferedReader br;

				  		public Scanner(InputStream system) {
				  			br = new BufferedReader(new InputStreamReader(system));
				  		}

				  		public Scanner(String file) throws Exception {
				  			br = new BufferedReader(new FileReader(file));
				  		}

				  		public String next() throws IOException {
				  			while (st == null || !st.hasMoreTokens())
				  				st = new StringTokenizer(br.readLine());
				  			return st.nextToken();
				  		}

				  		public String nextLine() throws IOException {
				  			return br.readLine();
				  		}

				  		public int nextInt() throws IOException {
				  			return Integer.parseInt(next());
				  		}

				  		public double nextDouble() throws IOException {
				  			return Double.parseDouble(next());
				  		}

				  		public char nextChar() throws IOException {
				  			return next().charAt(0);
				  		}

				  		public Long nextLong() throws IOException {
				  			return Long.parseLong(next());
				  		}

				  		public boolean ready() throws IOException {
				  			return br.ready();
				  		}

				  		public void waitForInput() throws InterruptedException {
				  			Thread.sleep(3000);
				  		}
				  	}
			      }
				 