#include #define rep(i,n) for(int i=0;i<(n);++i) using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; vector> st; rep(i,s.size()){ if(s[i]=='>'){ if(st.size()>=2 && st[st.size()-1].first=='=' && st[st.size()-2].first=='<'){ st.pop_back(); st.pop_back(); continue; } } else if(s[i]=='='){ if(st.size()>=1 && st.back().first=='='){ st.back().second++; continue; } } st.push_back(make_pair(s[i],1)); } int ans = 0; rep(i,st.size()) ans += st[i].second; cout << ans << endl; }