#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int _ = 1;
  cin >> _;
  while (_--) {
    int n;
    cin >> n;
    vector<char> s(n);
    for (int i = 0; i < n; i++) {
      cin >> s[i];
    }
    int cnt = 0;
    bool ok = true;
    for (int i = 0; i < n - 1 && ok; i++) {
      ok = false;
      for (int j = 1; j < s.size(); j++) {
        if (s[j] == '>' && s[j - 1] == '<') {
          s.erase(s.begin() + j);
          ok = true;
          cnt++;
          break;
        }
      }
    }
    cout << cnt << endl;
  }
}
