#include using namespace std; int main(){ string S; cin >> S; string T; int cnt = 0; for (char c : S){ if (c == '>' and cnt > 0){ if (T.back() != '='){ T += c; cnt = 0; continue; } while (T.back() == '='){ T.pop_back(); } T.pop_back(); cnt--; } else { if (c == '<'){ cnt++; } T += c; } } cout << T.size() << endl; }