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