#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, sol = 0;
    cin >> n;
    string S;
    cin >> S;
    for (int i = 0; sol < n && i < n && S[i] == '<'; ++i) sol++;
    for (int i = n - 1; sol > n && i >= 0 && S[i] == '>'; --i) sol++;
    cout << sol << endl;
  }
  return 0;
}
