s=io.read()

bigger={}
bigger[#s+1]=0
for i=#s,1,-1 do
    inequality=s:sub(i,i)
    if inequality==">" then
        bigger[i]=bigger[i+1]+1
    else
        bigger[i]=0
    end
end

smaller={}
smaller[1]=0
for i=1,#s do
    inequality=s:sub(i,i)
    if inequality=="<" then
        smaller[i+1]=smaller[i]+1
    else
        smaller[i+1]=0
    end
end

total=0
for i=1,#s+1 do
    total=total+math.max(bigger[i],smaller[i])
end
print(total)