#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); string s; cin >> s; vector> rle; for (int i = 0; i < s.size(); i++) { if (rle.empty() || rle.back().first != s[i]) { rle.push_back({s[i], 1}); } else { rle.back().second++; } } int l = rle.size(); vector> st; for (auto [c, cnt] : rle) { if (c == '>' && st.size() > 1 && st.back().first == '=' && st[st.size() - 2].first == '<') { st.pop_back(); st.back().second--; if (st.back().second == 0) { st.pop_back(); } if (cnt > 1) { st.push_back({c, cnt - 1}); } } else { st.push_back({c, cnt}); } } int ans = 0; for (auto [c, cnt] : st) { ans += cnt; } cout << ans << endl; }