#include <stdio.h>
char string[1000005];
int main()
{
int t,i,lesscount;
long long answer;
while(t--)
{
if(string[0] != '<')
else
{
answer=0;
lesscount=1;
for(i=1;string[i]!='\0';i++)
{
if(string[i]=='>')
{
lesscount--;
if(lesscount >= 0)
answer++;
else
break;
}
else if(string[i]=='<')
lesscount++;
}
// if(flag==0)
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpjaGFyIHN0cmluZ1sxMDAwMDA1XTsKCmludCBtYWluKCkKewoJaW50IHQsaSxsZXNzY291bnQ7Cglsb25nIGxvbmcgYW5zd2VyOwoJc2NhbmYoIiVkIiwmdCk7Cgl3aGlsZSh0LS0pCgl7CgkJc2NhbmYoIiVzIixzdHJpbmcpOwoJCWlmKHN0cmluZ1swXSAhPSAnPCcpCgkJCXByaW50ZigiMFxuIik7CgkJZWxzZQoJCXsKCQkJYW5zd2VyPTA7CgkJCWxlc3Njb3VudD0xOwoJCQlmb3IoaT0xO3N0cmluZ1tpXSE9J1wwJztpKyspCgkJCXsKCQkJCWlmKHN0cmluZ1tpXT09Jz4nKQoJCQkJewoJCQkJCWxlc3Njb3VudC0tOwoJCQkJCWlmKGxlc3Njb3VudCA+PSAwKQoJCQkJCQlhbnN3ZXIrKzsKCQkJCQllbHNlCgkJCQkJCWJyZWFrOwoJCQkJfQoJCQkJZWxzZSBpZihzdHJpbmdbaV09PSc8JykKCQkJCQlsZXNzY291bnQrKzsKCQkJfQovLwkJCWlmKGZsYWc9PTApCgkJCXByaW50ZigiJWxsZFxuIiwyKmFuc3dlcik7CgkJfQoJfQoJcmV0dXJuIDA7Cn0K