for _ in range(int(raw_input())):
    print raw_input().replace('><', '<>').count('><')
44b66a43b926b222989bce1ef70c2084d88d6bef
for _ in range(int(raw_input())):
    print raw_input().replace('><', '<>').count('><')