#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; template using V=vector; template using VV=V>; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); string s; cin>>s; stack st; int n=s.size(); int ans=n; rep(i,n){ if(st.size()==0) st.push(s[i]); else if(s[i]!='>') st.push(s[i]); else{ int tmp=0; while(st.size() && st.top()=='='){ st.pop(); tmp++; } if(tmp && st.size() && st.top()=='<'){ st.pop(); ans-=tmp+2; continue; } while(st.size()) st.pop(); } } cout<