let s = read_line ()
let a_s = Array.make (String.length s + 1) 0
let _ = String.(iteri (fun i c -> if c = '<' then a_s.(i + 1) <- a_s.(i) + 1) s; for i = length s - 1 downto 0 do if s.[i] = '>' then a_s.(i) <- max a_s.(i) @@ a_s.(i + 1) + 1 done); Array.fold_left (+) 0 a_s |> Printf.printf "%d\n"