let s = read_line ()
let h l g = let a, b = max l g, min l g in (a * (a + 1) + b * (b - 1)) / 2
let rec f l g p i a = if i >= String.length s then a + h l g else if s.[i] = p then if s.[i] = '<' then f (l + 1) g p (i + 1) a else f l (g + 1) p (i + 1) a else if s.[i] = '<' then f 1 0 s.[i] (i + 1) (a + h l g) else f l (g + 1) s.[i] (i + 1) a
let _ = Printf.printf "%d\n" @@ f 0 0 s.[0] 0 0