#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    string str;
    cin >> str;
    int num = 0;
    if (n == 1)
      cout << 0 << '\n';
    else if (n == 2 && str[0] == '<' && str[1] == '>')
      cout << 1 << '\n';
    else {
      for (int i = 1; i < n - 1; i++)
        if (str[i] == '<' && str[i + 1] == '>') num++;
      cout << num << '\n';
    }
  }
}
