#include <bits/stdc++.h>
using namespace std;
vector<int> v;
unsigned int convert(int n) { return log2(n & -n) + 1; }
int main() {
  int n;
  cin >> n;
  for (int j = 0; j < n; j++) {
    int a;
    cin >> a;
    string s;
    cin >> s;
    if (s[0] == '<' && s[a - 1] == '>') {
      int sum = 0, count = 0;
      for (int i = 0; i < a; i++) {
        if (s[i] == '<')
          count++;
        else
          break;
      }
      for (int i = a - 1; i >= 0; i--) {
        if (s[i] == '>')
          sum++;
        else
          break;
      }
      v.push_back(min(count, sum));
    } else
      v.push_back(0);
  }
  for (int i = 0; i < v.size(); i++) cout << v[i] << "\n";
  return 0;
}
