#include <bits/stdc++.h>
using namespace std;
int min(int a, int b) { return a > b ? b : a; }
int main() {
  int t, n, i;
  string s;
  cin >> t;
  while (t--) {
    cin >> n;
    cin >> s;
    int cnt1 = 0, cnt2 = 0;
    for (i = 0; i < n; i++) {
      if (s[i] == '<') {
        if (i == 0)
          cnt1++;
        else if (s[i - 1] != '>')
          cnt1++;
      }
    }
    for (i = 0; i < n; i++) {
      if (s[i] == '>') {
        if (i == n - 1)
          cnt2++;
        else if (s[i + 1] != '<')
          cnt2++;
      }
    }
    cout << min(cnt1, cnt2) << endl;
  }
  return 0;
}
