#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    string s;
    cin >> s;
    long long ans = 0;
    long long ans1 = 0;
    for (long long j = 0; j < x; j++)
      if (s[j] == '>' && j != x - 1) {
        s.erase(j + 1, 1);
      } else if (s[j] == '<' && j != 0) {
        s.erase(j - 1, 1);
      }
    if (s.size() == 0)
      cout << 0 << endl;
    else
      cout << max(ans, (long long)s.size() - 1) << endl;
  }
  return 0;
}
