#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 0;
  cin >> t;
  while (t--) {
    string s;
    int n = 0;
    cin >> n;
    cin >> s;
    bool firstl = 1, firstr = 1;
    bool meow = 0;
    int idxone = 0, firstidxone = 0, idxl = -1, idxr = 101;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '>') {
        break;
      } else if (s[n - i - 1] == '<')
        break;
      cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}
