import java.util.*;
import java.io.*;
public class Main
{
{
Scanner sc
= new Scanner
(System.
in);
int t = sc.nextInt();
char a[] = new char[1000005];
while(t-- > 0)
{
int length = br.read(a);
int x=0,i=0,ans=0;
for(i=0 ; i<length ; i++)
{
if(a[i] == '<')
x++;
else
x--;
if(x<0)
break;
if(x==0)
ans=i+1;
}
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5pby4qOwpwdWJsaWMgY2xhc3MgTWFpbgp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmcgYXJnc1tdKSB0aHJvd3MgSU9FeGNlcHRpb24KCXsKCQlCdWZmZXJlZFJlYWRlciBiciA9IG5ldyBCdWZmZXJlZFJlYWRlcihuZXcgSW5wdXRTdHJlYW1SZWFkZXIoU3lzdGVtLmluKSk7CgkJU2Nhbm5lciBzYyA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJCgkJaW50IHQgPSBzYy5uZXh0SW50KCk7CgkJY2hhciBhW10gPSBuZXcgY2hhclsxMDAwMDA1XTsKCQkKCQoJCXdoaWxlKHQtLSA+IDApCgkJewoJCQlpbnQgbGVuZ3RoID0gYnIucmVhZChhKTsKCQkJaW50IHg9MCxpPTAsYW5zPTA7CgoJCQlmb3IoaT0wIDsgaTxsZW5ndGggOyBpKyspCgkJCXsKCQkJCWlmKGFbaV0gPT0gJzwnKQoJCQkJCXgrKzsKCQkJCWVsc2UKCQkJCQl4LS07CgkJCQlpZih4PDApCgkJCQkJYnJlYWs7CgkJCQlpZih4PT0wKQoJCQkJCWFucz1pKzE7CgkJCX0KCQkJU3lzdGVtLm91dC5wcmludGxuKGFucyk7CgkJfQoJfQp9