S = gets.chomp
a = []
m = 0
n = 0
answer = 0
if S[0] == ">"
    a.push(0)
end
for i in 0...S.size do
    if S[i] == "<"
        if n > 0
            a.push(n)
            n = 0
        end
        m += 1
    else
        if m > 0
            a.push(m)
            m = 0
        end
        n += 1
    end
end
if S[-1] == "<"
    a.push(m)
    a.push(0)
else
    a.push(n)
end
for i in 0...a.size/2 do
    j = 2*i
    x = a[j]
    y = a[j+1]
    answer += x*(x+1)/2
    answer += y*(y+1)/2
    if x > y
        answer -= y
    else
        answer -= x
    end
end
puts answer