S = gets.chomp.chars
fromL = [0]
fromR = [0]
S.each do |c|
    if c == "<"
        fromL << fromL[-1] + 1
    else
        fromL << 0
    end
end
S.reverse.each do |c|
    if c == ">"
        fromR << fromR[-1] + 1
    else
        fromR << 0
    end
end
p fromL.zip(fromR.reverse).map(&:max).inject(:+)