#include <bits/stdc++.h>
using namespace std;
char s[1010];
int main()
{
    int T, n;
    scanf("%d", &T);
    while (T--)
    {
        scanf("%d%s", &n, s);
        int ans = n - 1;
        for (int i = 0; i < n; ++i)
            if (s[i] == '>' || s[n - 1 - i] == '<')
                ans = min(ans, i);
        printf("%d\n", ans);
    }
    return 0;
}