program main
	implicit none
    character(5*10**5)::s
    integer(8)::i,n,ans
    integer(8),allocatable::a(:),b(:),c(:)
    read(*,*)s
    n=len_trim(s)
    allocate(a(n+1))
    allocate(b(n+1))
    allocate(c(n+1))
    a=0
    b=0
    c=0
    do i=1,n
    	if(s(i:i)=='<')then
        	a(i+1)=a(i)+1
        end if
    end do
    
    do i=n,1,-1
    	if(s(i:i)=='>')then
        	b(i)=b(i+1)+1
        end if
    end do
    ans=0
    !do i=1,n+1
    !	c(i)=max(a(i:i),b(i:i))
    !end do
    c=max(a,b)
    write(*,*) sum(c)
    deallocate(a)
    deallocate(b)
    deallocate(c)
    stop
end program main

    
    