s = input() stack = [] cnt = 0 for t in s: stack.append(t) if t == '<': cnt += 1 elif t == '=': pass else: if cnt: if stack[-2] == '=': stack.pop() while stack[-1] == '=': stack.pop() stack.pop() cnt -= 1 else: cnt = 0 print(len(stack))