S = list(input()) + ["="] stack = [">"] ans = 0 for s in S: if s != ">": stack.append(s) else: if stack[-1] == "<": ans += len(stack) stack = [">"] else: temp = 0 while stack[-1] == "=": temp += 1 stack.pop() if stack[-1] == "<": stack.pop() else: ans += temp + len(stack) stack = [">"] ans += len(stack) - 2 print(ans)