let s = stdin.ReadLine()
let len = s.Length

let mutable a = Array.init (len + 1) (fun _ -> 0)
let mutable b = Array.init (len + 1) (fun _ -> 0)

for i in 0..(len - 1) do
 if s.[i] = '<' then a.[i+1] <- (a.[i] + 1) else ()

for i in 0..(len - 1) do
 if s.[(len - 1 )- i] = '>' then b.[i+1] <- (b.[i] + 1) else ()

let m = [for i in 0..len do yield max a.[i] b.[len - i]]

m
|>List.sum
|>stdout.WriteLine