#include <bits/stdc++.h>
using namespace std;
void text(void);
int main() {
  int n;
  cin >> n;
  while (n--) text();
  return 0;
}
void text(void) {
  int len, i, ans;
  char str[105];
  cin >> len >> str;
  for (i = 0; i < len; i++)
    if (str[i] == '>') break;
  ans = i;
  for (i = len - 1; i >= 0; i--)
    if (str[i] == '<') break;
  if (len - i - 1 < ans) ans = len - i - 1;
  cout << ans << endl;
}
