#include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); string S, T="", U=""; cin >> S; for (auto x : S){ if (x == '>'){ if (T.size() == 0 || U.size() == 0 || T.back() != '=' || U.back() != '<'){ T += x; U += x; continue; } while(T.back() == '='){ T.pop_back(); } T.pop_back(); U.pop_back(); } else if (x == '<'){ U += x; T += x; } else T += x; } cout << T.size() << endl; return 0; }