import sys input = sys.stdin.readline S=input().strip() X=[] for s in S: if X==[]: X.append([s,1]) else: if s=="=" and X[-1][0]==s: X[-1][1]+=1 else: X.append([s,1]) Y=[] for s,ko in X: if s==">" and len(Y)>=2 and Y[-1][0]=="=" and Y[-2][0]=="<": Y.pop() Y.pop() else: Y.append([s,ko]) while len(Y)>=2 and Y[-1][0]=="=" and Y[-2][0]=="=": s,ko=Y.pop() Y[-1][1]+=ko ANS=0 for s,ko in Y: ANS+=ko print(ANS)