#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<char> arr;
    for (int i = 0; i < n; i++) {
      char a;
      cin >> a;
      arr.push_back(a);
    }
    for (int i = 0; i < arr.size(); i++) {
      if (arr[i] == '>' && i + 1 < arr.size()) {
        arr.erase(arr.begin() + i + 1);
        i--;
      } else if (arr[i] == '<' && i > 0) {
        arr.erase(arr.begin() + i - 1);
        i--;
      }
    }
    cout << arr.size() - 1 << endl;
  }
  return 0;
}
