#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    char str[n];
    cin >> n;
    for (int j = 0; j < n; j++) {
      cin >> str[j];
    }
    int count_up = 0, count_down = 0;
    ;
    for (int j = 0; j < n; j++) {
      if (str[j] == '>') {
        break;
      }
      count_up++;
    }
    for (int j = n - 1; j <= 0; j--) {
      if (str[j] == '<') {
        break;
      }
      count_down++;
    }
    if (str[0] == '<' && str[n - 1] == '>')
      cout << 1;
    else {
      if (count_down > count_up) {
        cout << count_up;
      } else {
        cout << count_down;
      }
    }
  }
}
