#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int tc;
  cin >> tc;
  while (tc--) {
    long long n, k;
    string s;
    cin >> n >> s;
    k = s.length();
    if (s[0] == '<' && s[k - 1] == '>')
      k = 1;
    else
      k = 0;
    cout << k << "\n";
  }
  return 0;
}
