S = input() import re for i in range(500000): S = re.sub("<=+>","",S) print(len(S)) exit()