#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    if (s[0] == '>' || s[n - 1] == '<') {
      cout << 0 << endl;
    } else {
      map<char, int> m;
      m['>'] = 0, m['<'] = 0;
      for (int i = 0; i < n; i++) m[s[i]]++;
      int count = 0;
      for (int i = 0; i < n - 1; i++) {
        if (s[i] == '>' && s[i + 1] == '<') count++;
      }
      if (m['>'] > m['<']) {
        cout << m['<'] - count << endl;
      } else {
        cout << m['>'] - count << endl;
      }
    }
  }
}
