typedef long long ll; typedef long double ld; #include using namespace std; signed main() { string s; std::cin >> s; stack> st; ll n = s.size(); ll m = n; ll ald = 0; for (int i = 0; i < n; i++) { if(st.size()==0){ ald = 0; if(s[i]=='<'){ st.push({i,false}); } }else{ if(s[i]=='<'){ st.push({i,false}); }else if(s[i]=='='){ st.top().second = true; }else{ if(st.top().second){ m -= i-st.top().first+1-ald; ald += i-st.top().first+1; st.pop(); }else{ while(st.size()){ st.pop(); } } } } } std::cout << m << std::endl; };