program AGC40
  character(500000)::S
  integer,allocatable::A(:)
  read(*,*)S
  N=len_trim(S)+1
  allocate(A(N))
  A=500000
  if(S(1:1)=='<') A(1)=0
  if(S(N-1:N-1)=='>') A(N)=0
  do i=1,N-1
     if(S(i:i)=='>' .and. S(i+1:i+1)=='<') A(i+1)=0
  end do
  do i=1,N-1
     if(S(i:i)=='<') A(i+1)=A(i)+1
  end do
  do i=N,2,-1
     if(S(i-1:i-1)=='>' .and. (A(i-1)==500000 .or. A(i-1)<=A(i))) A(i-1)=A(i)+1        
  end do
  write(*,*)sum(A)
end program AGC40