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.math.*;
import java.io.*;
 
public class practice {
    public static void merge(int arr[], int l, int m, int r) {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;
 
        /* Create temp arrays */
        int L[] = new int[n1];
        int R[] = new int[n2];
 
        /*Copy data to temp arrays*/
        for (int i = 0; i < n1; ++i)
            L[i] = arr[l + i];
        for (int j = 0; j < n2; ++j)
            R[j] = arr[m + 1 + j];
 
 
        /* Merge the temp arrays */
 
        // Initial indexes of first and second subarrays
        int i = 0, j = 0;
 
        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2) {
            if (L[i] <= R[j]) {
                arr[k] = L[i];
                i++;
            } else {
                arr[k] = R[j];
                j++;
            }
            k++;
        }
 
        /* Copy remaining elements of L[] if any */
        while (i < n1) {
            arr[k] = L[i];
            i++;
            k++;
        }
 
        /* Copy remaining elements of R[] if any */
        while (j < n2) {
            arr[k] = R[j];
            j++;
            k++;
        }
    }
 
    // Main function that sorts arr[l..r] using
    // merge()
    public static void sort(int arr[], int l, int r) {
        if (l < r) {
            // Find the middle point
            int m = (l + r) / 2;
 
            // Sort first and second halves
            sort(arr, l, m);
            sort(arr, m + 1, r);
 
            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }
 
    public static int isSubstring(String s1, String s2) {
        int M = s1.length();
        int N = s2.length();
 
        /* A loop to slide pat[] one by one */
        for (int i = 0; i <= N - M; i++) {
            int j;
 
            /* For current index i, check for
            pattern match */
            for (j = 0; j < M; j++)
                if (s2.charAt(i + j) != s1.charAt(j))
                    break;
 
            if (j == M)
                return i;
        }
 
        return -1;
    }
 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        for(int i=0;i<t;i++){
            int n = Integer.parseInt(br.readLine());
            String s = br.readLine();
            if(s.charAt(0) == '<' && s.charAt(n-1) == '>'){
                int r = 0;
                int j = 0;
                while (j<n){
                    if(s.charAt(j) == '<'){
                        r++;
                    }
                    else{
                        break;
                    }
                    j++;
                }
                int k=0;
                j=n-1;
                while (j>=0){
                    if(s.charAt(j) == '>'){
                        k++;
                    }
                    else{
                        break;
                    }
                    j--;
                }
                System.out.println(Math.min(r,k));
            }
            else{
                System.out.println(0);
            }
        }
    }
}