#include <bits/stdc++.h>
using namespace std;
char a[110];
int main() {
  int T, n;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    scanf("%s", a + 1);
    int h = 0, t = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] == '<')
        h++;
      else
        break;
    }
    for (int i = n; i >= 1; i--) {
      if (a[i] == '>')
        t++;
      else
        break;
    }
    printf("%d\n", min(h, t));
  }
  return 0;
}
