program main
  implicit none
  character(5*10**5) :: s
  integer ::  n, i, k, j, l, m, ans
  integer, allocatable :: a(:)

  read(*,*) s
  n = len_trim(s) + 1

  ans = 0
  do i = 1, n-1
     if(s(i:i) == '<') then
        k = i
     do j = 1, n-1
        if (s(j:j) == '>') then
           l = j
           exit
        end if
     end do

     do j = l, n-1
        if(s(j:j) == '<') then
           m = i
           exit
        end if
     end do

     if (l >= m) then
        ans = ans + l*(l+1)/2 + m*(m-1)/2
     else
        ans = ans + m*(m+1)/2 + l*(l-1)/2
     end if

  end if
end do

write(*,*) ans

stop
end program main



        
