s = gets.chomp

n = s.size + 1
a = Array.new(n, 0)
b = Array.new(n, 0)

cnt = 0
for i in 0...s.size
    if s[i] == '<'
        cnt += 1
    else
        cnt = 0
    end
    a[i+1] = cnt
end

cnt = 0
for i in 1..s.size
    if s[s.size - i] == '>'
        cnt += 1
    else
        cnt = 0
    end
    b[s.size - i] = cnt
end

ans = 0
for i in 0...n
    ans += a[i] > b[i] ? a[i] : b[i]
end

puts ans