S=gets.chomp

sum=0
i = 0
while i < S.length
    l=0
    r=0
    while S[i] == '<'
        i += 1
        l += 1
    end
    while S[i] == '>'
        i += 1
        r += 1
    end
    min,max=[l,r].minmax
    sum += (min-1)*min/2 
    sum += max*(max+1)/2
end
puts sum
