package main import . "fmt" func main() { var s string Scan(&s) sr:=[]rune{} sc:=[]int{} for _,r:=range s { switch r { case '<': sr=append(sr,r) sc=append(sc,1) case '=': k:=len(sr)-1 if k>=0&&sr[k]==r { sc[k]++ } else { sr=append(sr,r) sc=append(sc,1) } case '>': p:=len(sr)-2 if p>=0&&sr[p+1]=='='&&sr[p]=='<' { sr=sr[:p] sc=sc[:p] } else { sr=append(sr,r) sc=append(sc,1) } } } a:=0 for _,c:=range sc { a+=c } Println(a) }