#include <bits/stdc++.h>
using namespace std;
long long a[1000005], n;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T;
  for (cin >> T; T--;) {
    cin >> n >> s;
    int x = 0, y = 0;
    for (int i = 0; i < s.size() && s[i] == '<'; ++i) ++x;
    for (int i = s.size() - 1; i >= 0 && s[i] == '>'; ++i) ++y;
    cout << min(x, y) << "\n";
  }
}
