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: > < < → < < → <.
#include <bits/stdc++.h>
using namespace std;
void prt(long x) { cerr << x; }
void prt(long long x) { cerr << x; }
void prt(unsigned x) { cerr << x; }
void prt(unsigned long x) { cerr << x; }
void prt(unsigned long long x) { cerr << x; }
void prt(float x) { cerr << x; }
void prt(double x) { cerr << x; }
void prt(long double x) { cerr << x; }
void prt(char x) { cerr << '\'' << x << '\''; }
void prt(const char *x) { cerr << '\"' << x << '\"'; }
void prt(const string &x) { cerr << '\"' << x << '\"'; }
void prt(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void prt(const pair<T, V> &x) {
  cerr << '{';
  prt(x.first);
  cerr << ',';
  prt(x.second);
  cerr << '}';
}
template <typename T>
void prt(const T &x) {
  long long f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), prt(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  prt(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
void err(istream_iterator<string> it) {}
template <typename T, typename... brgs>
void err(istream_iterator<string> it, T a, brgs... args) {
  cerr << *it << " = " << a << "\n";
  err(++it, args...);
}
const long long mod = 1000000007;
const long long N = 3e5;
char alphabet[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                     'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                     's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
map<long long, long long> Fib;
long long kadane(long long *a, long long n);
bool isPrime(long long n);
long long mpow(long long a, long long b);
long long fib(long long n);
long long cmp(long long a, long long b) { return a > b; }
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long i = 0, m1 = 0;
  while (s[i] == '<' && i < n) {
    i++;
    m1++;
  }
  i = n - 1;
  long long m2 = 0;
  while (s[i] == '>' && i >= 0) {
    i--;
    m2++;
  }
  cout << min(m1, m2) << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) solve();
}
long long mpow(long long a, long long b) {
  long long m = mod;
  long long x = 1;
  while (b > 0) {
    if (b & 1) {
      x = (x * a) % m;
    }
    a = (a * a) % m;
    b >>= 1;
  }
  return x;
}
long long fib(long long n) {
  Fib[0] = Fib[1] = 1;
  if (Fib.count(n)) return Fib[n];
  long long k = n / 2;
  if (n % 2 == 0) {
    return Fib[n] = (fib(k) * fib(k) + fib(k - 1) * fib(k - 1)) % mod;
  } else {
    return Fib[n] = (fib(k) * fib(k + 1) + fib(k - 1) * fib(k)) % mod;
  }
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long kadane(long long *a, long long n) {
  long long max_so_far = INT_MIN, max_ending_here = 0;
  for (__typeof(n) i = (0); i != (n); i += 1 - 2 * ((0) > (n))) {
    max_ending_here += a[i];
    max_so_far = max(max_so_far, max_ending_here);
    if (max_ending_here < 0) max_ending_here = 0;
  }
  return max_so_far;
}
