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