program prob5
    implicit none
    character(len=500005) :: s
    character(len=1) :: tmps
    integer(8) :: is(500005), n, i, tmp, tmpi
    integer(8) :: ans
    read(*,*) s

    n = len_trim(s) + 1

    do i = 1, n
        is(i) = 0
    end do

    if(s(1:1) == '<') then
        tmpi = 1
        tmps = '<'
    else
        tmpi = 2
        is(1) = 0
        tmps = '>'
    end if
    tmp = 1
    do i = 2, n-1
        if (s(i:i) == tmps) then
            tmp = tmp + 1
        else
            is(tmpi) = tmp
            tmp = 1
            tmpi = tmpi + 1
            tmps = s(i:i)
        end if
    end do
    is(tmpi) = tmp

    
    ans = 0
    do i = 1, n
        ans = ans + is(i) * (is(i) - 1) / 2
    end do

    do i = 1, n
        if (mod(i,2) == 0) then
            cycle
        else
            ans = ans + max(is(i), is(i+1))
        end if
    end do
   
    write(*,*) ans

    stop
contains
end program prob5