#include <bits/stdc++.h>
const int N = 1e2 + 5, mod = 1e9 + 7;
using namespace std;
int t, n;
char a[N];
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> a;
    int cot = 0;
    if (a[0] == '>' || a[n - 1] == '<')
      puts("0");
    else {
      for (int i = 0; i < n - 1; i++)
        if (a[i] == '<' && a[i + 1] == '>') cot++;
      printf("%d\n", cot);
    }
  }
  return 0;
}
