#include <bits/stdc++.h>
using namespace std;
char s[1000];
int n, m, k;
int main() {
  int t;
  scanf("%d", &t);
  for (int ii = 0; ii < t; ++ii) {
    scanf("%d", &n);
    scanf("%s", s);
    if (s[0] == '>' || s[n - 1] == '<') {
      puts("0");
      continue;
    } else {
      int x = 1, y = 1;
      int i = 1;
      while (i < n && s[i] == s[i - 1]) i++, x++;
      i = n - 2;
      while (i >= 0 && s[i] == s[i + 1]) y++, i--;
      x = min(x, y);
      printf("%d\n", x);
    }
  }
  return 0;
}
