using System.Collections.Generic; using System; public class Hello { static void Main() { var s = Console.ReadLine().Trim(); getAns(s); } static void getAns(string s) { var st = new Stack(); var f = false; foreach (var x in s) { if (x == '<') { st.Push(0); f = false; } else if (x == '=') { var top = st.Peek(); if (top == 0) f = true; else if (top == 1) continue; st.Push(1); } else { if (f) { while (true) { if (st.Pop() == 0) break; } } else st.Push(2); } } Console.WriteLine(st.Count); } }