#include #include using namespace std; using ll = long long; int main(){ string s; cin >> s; vector> stack; for (char i: s){ if (i == '<') { stack.emplace_back(0, 1); } else if (i == '='){ if (stack.empty() || stack.back().first != 1) stack.emplace_back(1, 1); else stack.back().second++; } else{ if (stack.size() >= 2 && stack[stack.size() - 2].first == 0 && stack.back().first == 1){ stack.pop_back(); stack.pop_back(); } else stack.emplace_back(2, 1); } } int ans = 0; for(auto p: stack) ans += p.second; cout << ans << endl; }