import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;

immutable long MOD = 10^^9 + 7;

void solve() {
    auto N = readln.chomp.to!int;
    auto S = readln.chomp;
    int ans = 1 << 29;
    foreach (i; 0..N) {
        if (S[i] == '>' || S[N - i - 1] == '<') {
            ans = i;
            break;
        }
    }
    ans.writeln;
}

void main() {
    auto T = readln.chomp.to!int;
    while (T--) solve;
}
