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