#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  ;
  string s;
  cin >> s;
  long long int r = 0, l = 0;
  long long int i = 0;
  if (s[0] == '<') {
    while (s[i] == '<') {
      r++;
      i++;
    }
    while (s[i] == '>') {
      l++;
      i++;
    }
    if (i == n) {
      cout << min(l, r) << "\n";
    } else {
      cout << 0 << "\n";
    }
  } else {
    cout << 0 << "\n";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t-- > 0) {
    solve();
  }
  return 0;
}
