#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t;
    string s;
    cin >> t >> s;
    int cnt = 0;
    for (int i = 0; i < t; i++) {
      if (s[i] == '<')
        cnt++;
      else
        break;
    }
    for (int i = t - 1; i >= 0; i--) {
      if (s[i] == '>')
        cnt++;
      else
        break;
    }
    cout << max(0, cnt - 1) << endl;
  }
}
