#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    int n;
    int cnt1 = 0, cnt2 = 0;
    cin >> n;
    cin >> s;
    int j = n - 1;
    for (int i = 0; i < n; i++) {
      if (s[i] != '>') {
        cnt1++;
      }
      if (s[j] != '<') {
        cnt2++;
        break;
      }
      if (s[i] == '>' || s[j] == '<') {
        break;
      }
      j--;
    }
    cout << min(cnt2, cnt1) << endl;
  }
  return 0;
}
