#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); string s; cin >> s; string st = ""; bool has_l = false, has_e = false; for (char c : s) { if (c == '<') { has_l = true; has_e = false; st += c; } else if (c == '=') { if (has_l) { has_e = true; } st += c; } else { if (has_l && has_e) { while (st.back() == '=') { st.pop_back(); } assert(st.back() == '<'); st.pop_back(); } else { has_l = false; has_e = false; st += c; } } } cout << st.size() << endl; }