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