s = gets.chomp
n = s.size
num = Array.new(n+1,0)


j = 0
while s[j] == "<"
    num[j+1] = num[j] + 1
    j += 1
end

(n-1).times do |i|
    if s[i] == ">" && s[i+1] == "<"
        j = 0
        while s[i-j] == ">"
            num[i-j] = num[i-j+1] + 1 if num[i-j] < num[i-j+1] + 1
            j += 1
        end

        j = 1
        while s[i+j] == "<"
            num[i+j+1] = num[i+j] + 1 if num[i+j+1] < num[i+j] + 1
            j += 1
        end
    end
end

j = 0
while s[n-j-1] == ">"
    num[n-j-1] = num[n-j] + 1 if num[n-j-1] < num[n-j] + 1
    j += 1
end

#p num
puts num.inject(:+)