#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
void print(vector<int> &v) {
  cout << "v = ";
  for (int i = 0; i < v.size(); ++i) {
    cout << v[i] << " ";
  }
  cout << endl;
}
const long long MOD = 1000 * 1000 * 1000 + 7;
const int MAXN = 1 << 17;
const int MAXQ = 1 << 17;
vector<pair<int, int> > G[MAXN];
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    int n;
    cin >> n >> s;
    int ans = 0;
    if (s[0] == '>' || s.back() == '<') {
      ans = 0;
    } else {
      int c = 0;
      for (int i = 0; i < n; ++i) {
        if (s[i] == '<') {
          c++;
        }
      }
      ans = min(c, n - c);
    }
    cout << ans << endl;
  }
  return 0;
}
