#include using namespace std; int main() { string S; cin >> S; vector> T; T.push_back({S[0], 0}); for (int i = 1; i < (int)S.size(); i++) { if (S[i - 1] == '=' && S[i] == '=') { // } else { T.push_back({S[i], i}); } } stack> st; vector imos((int)S.size() + 1, 0); cout << endl; for (int i = 0; i < (int)T.size(); i++) { st.push(T[i]); while ((int)st.size() >= 3) { auto [a, x] = st.top(); st.pop(); auto [b, y] = st.top(); st.pop(); auto [c, z] = st.top(); st.pop(); string abc = ""; abc += c; abc += b; abc += a; // cout << "### " << abc << endl; if (abc == "<=>") { imos[z]++; imos[x + 1]--; } else { st.push({c, z}); st.push({b, y}); st.push({a, x}); break; } } } for (int i = 0; i < (int)S.size(); i++) { imos[i + 1] += imos[i]; } int ans = 0; for (int i = 0; i < (int)S.size(); i++) { if (imos[i] == 0) { ans++; } } cout << ans << endl; return 0; }