from itertools import groupby S = list(input()) rle_S = [] for s, array in groupby(S): if s == "=": rle_S.append((s, len(list(array)))) else: rle_S.extend([(s, 1)] * len(list(array))) stack = [] for s, length in rle_S: stack.append((s, length)) if len(stack) >= 2: pre_s, pre_length = stack[-2] if pre_s == s == "=": stack.pop() stack.pop() stack.append((s, length + pre_length)) if len(stack) >= 3: pre2_s, pre2_length = stack[-3] if pre2_s + pre_s + s == "<=>": stack.pop() stack.pop() stack.pop() print(sum(length for _, length in stack))