let explode s =
  let rec exp i l =
    if i < 0 then l else exp (i - 1) (s.[i] :: l) in
  exp (String.length s - 1) []

let rec print_int_list = function
    [] -> ()
  | [x] -> print_int x
  | (x :: xs) -> print_int x;
                 print_char ' ';
                 print_int_list xs
let left_less l =
  let (sum, ans) = List.fold_left (fun (sum,li)  c ->
            if c = '<' then (sum+1, (sum+1)::li)
            else (0, 0 :: li) ) (0,[0]) l
  in
  List.rev ans

let right_gtr l =
  let (sum, ans) = List.fold_right (fun c (sum,li) ->
            if c = '>' then (sum+1, (sum+1)::li)
            else (0, 0 :: li) ) l (0,[0])
  in
  ans
                 
let () =
  let s = Scanf.sscanf (input_line stdin) "%s" (fun a -> a) in
  let l = explode s in
  let left = left_less l in
  let right = right_gtr l in
  let ans =
    List.fold_left (+) 0
      (List.map2 (fun a b -> max a b) left right)
  in
  print_int ans;
  print_newline ()
