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