#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
int t, n;
char s[105];
int main() {
  t = read();
  for (int tt = 1; tt <= t; tt++) {
    n = read();
    int cnt = 0;
    scanf("%s", s + 1);
    for (int i = 1; s[i]; i++) cnt += (s[i] == '>' ? 1 : 0);
    if (cnt == 0 || cnt == n) {
      printf("0\n");
      continue;
    }
    cnt = 0;
    int pos = 1;
    while (s[pos] == '<') cnt++, pos++;
    int cnt2 = 0;
    pos = n;
    while (s[pos] == '>') cnt2++, pos--;
    printf("%d\n", min(cnt, cnt2));
  }
  return 0;
}
