#include #include #include #include #include #include #include #include #include #include using namespace std; struct MyChar { char c; int cnt; MyChar(char _c){ c = _c; cnt = 1; } }; int main() { string s; cin >> s; string t; vector v; for (char c: s) { if (v.empty()) { v.emplace_back(c); } else { if (v.back().c == '=' && c == '=') { v.back().cnt++; } else { v.emplace_back(c); } } } auto show = [](vector v) -> void { for (auto mc: v) { fprintf(stderr, "(%c, %d) ", mc.c, mc.cnt); } cout << endl; // cout << s << endl; }; vector u; for (auto mc: v) { // fprintf(stderr, "-----\n"); // show(u); u.push_back(mc); if (u.size() < 3) { continue; } int n = u.size(); if (u[n-3].c == '<' && u[n-2].c == '=' && u[n-1].c == '>') { u.pop_back(); u.pop_back(); u.pop_back(); } // show(u); } int ans = 0; for (auto mc: u) { ans += mc.cnt; } cout << ans << endl; return 0; }