#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265359;
const double EPS = 1e-6;
const long long INF = (1LL << 62);
const long long P = 1e9 + 7;
long long del_ct(string &s, long long pos) {
  long long ct = 0;
  for (int i = 0; i < s.length(); i++) {
    if (i == pos) continue;
    if (i < pos) {
      if (s[i] != '>') ct++;
    } else {
      if (s[i] != '<') ct++;
    }
  }
  return ct;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t, n;
  string s;
  cin >> t;
  while (t--) {
    cin >> n;
    cin >> s;
    long long best = INF;
    for (int i = 0; i < n; i++) {
      best = min(best, del_ct(s, i));
    }
    cout << best << endl;
  }
  return 0;
}
