#include <bits/stdc++.h>
using namespace std;
bool was[101];
int main() {
  int t;
  cin >> t;
  int ans = 0;
  for (int i = 1; i <= t; i++) {
    int n;
    cin >> n;
    string second;
    cin >> second;
    bool ok = false;
    ans = 0;
    for (int j = 1; j < n; j++) {
      if (second[j - 1] == '<' && second[j] == '>') {
        ans++;
        break;
      }
    }
    if (second[0] == '>' && second[n - 1] == '<') {
      cout << 0 << endl;
    } else
      cout << ans << endl;
  }
  return 0;
}
