def main(): S = input() decided = [] stack = [] for letter in S: if not stack: if letter == "<": stack.append(letter) continue decided.append(letter) continue match stack[-1]: case "=": if letter in ("=", "<"): stack.append(letter) continue if letter == ">": while stack[-1] in ("=", "<"): popped = stack.pop() if popped == "<": break continue case "<": if letter in ("<", "="): stack.append(letter) continue if letter == ">": decided.append(letter) decided.extend(stack) stack.clear() continue case _: raise ValueError print(len(stack) + len(decided)) if __name__ == "__main__": main()