#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    char s[110];
    cin >> n >> s;
    int in = 0, fin = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '<') {
        in++;
      } else {
        break;
      }
    }
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] == '>') {
        fin++;
      } else {
        break;
      }
    }
    if (in > fin) {
      cout << fin << endl;
    } else {
      cout << in << endl;
    }
  }
  return 0;
}
