using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var s = ReadLine(); var ans = s.Length; var st = new Stack(); foreach (var c in s) { if (c == '>') { var count = 1; while (st.Count > 0 && st.Peek() == '=') { ++count; st.Pop(); } if (count > 1 && st.Count > 0 && st.Peek() == '<') { ans -= count + 1; st.Pop(); } else { st = new Stack(); } } else st.Push(c); } WriteLine(ans); } }