s=input() r=[] for i in range(len(s)): if s[i]=="<": r.append(["<",1]) elif s[i]=="=": if r[-1][0]=="=": r[-1][1]+=1 else: r.append(["=",1]) else: if len(r)>1: if r[-1][0]=="=" and r[-2][0]=="<": r.pop() r.pop() else: r.append([">",1]) else: r.append([">",1]) ans=0 for x in r: ans+=x[1] print(ans)