#include #define rep(i, n) for(long long i = 0; i < n; i++) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; using ld = long double; int main() { string s; cin >> s; stack st1, st2, st3; st1.emplace(-1); st2.emplace(-1); st3.emplace(-1); rep(i, (int)s.size()) { if (s[i] == '<') { st1.emplace(i); } else if (s[i] == '=') { st2.emplace(i); } else { int x = st1.top(), y = st2.top(), z = st3.top(); if (z < x && z < y && x < y) { while (st2.top() > st1.top()) { st2.pop(); } st1.pop(); } else { st3.emplace(i); } } } cout << (int)st1.size() + (int)st2.size() + (int)st3.size() - 3 << endl; }