#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    string s;
    cin >> s;
    long long int x = 0, y = 0;
    for (long long int i = 0; i < n; i++) {
      if (s[i] == '<') {
        x++;
      } else
        y++;
    }
    if (x == n || y == n) {
      cout << "0" << endl;
    } else {
      long long int p = 0;
      for (long long int i = 0; i < n - 1; i++) {
        if (s[i] == '>' && s[i + 1] == '<') {
          p = 1;
          cout << "0" << endl;
          break;
        }
      }
      if (p == 0) {
        cout << min(x, y) << endl;
      }
    }
  }
}
