#include <bits/stdc++.h>
using namespace std;
const long long MAX = 3e5 + 5;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    long long count = 0;
    if (s[0] == '<') {
      count++;
    }
    int flag_s, flag_p = 0;
    for (long long p = 0; p <= n; p++) {
      if (s[p] == '<') {
        flag_s = 1;
      }
      if (s[p] == '>') {
        flag_p = 1;
      }
    }
    if ((flag_p == 0) || (flag_s == 0)) {
      count = 0;
    }
    cout << count << endl;
  }
}
