#include <bits/stdc++.h>
using namespace std;
bool vis[105];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    string ss;
    string s;
    fill(vis, vis + 105, 0);
    int n;
    scanf("%d", &n);
    cin >> s;
    while (1) {
      fill(vis, vis + 105, 0);
      for (int i = 0; i < s.length(); i++) {
        if (s[i] == '<' && i != 0)
          vis[i - 1] = 1;
        else if (s[i] == '>')
          vis[i + 1] = 1;
      }
      for (int i = 0; i < s.length(); i++) {
        if (vis[i] == 0) ss = ss + s[i];
      }
      if (s.length() == ss.length()) break;
      s.clear();
      s = ss;
      ss.clear();
    }
    if (ss.length() == 1)
      printf("0\n");
    else
      printf("%d\n", ss.length() - 1);
  }
  return 0;
}
