def Run_Length(lst): run_length=[] if lst: prev=lst[0] cnt=1 for x in lst[1:]: if x==prev: cnt+=1 else: run_length.append((prev,cnt)) prev=x cnt=1 run_length.append((prev,cnt)) return run_length S=input() queue=[] for s in S: if queue and queue[-1][0]=="=" and s=="=": queue[-1][1]+=1 else: queue.append([s,1]) if len(queue)>=3 and (queue[-3][0],queue[-2][0],queue[-1][0])==("<","=",">"): queue.pop() queue.pop() queue.pop() ans=sum(c for s,c in queue) print(ans)