program gt_lt
  implicit none
  character(500000) :: s
  integer :: n, i, f(0:500000) = 0, a(0:500000) = 0
  read(*,*) s
  n = len_trim(s)
  f(0) = -1
  f(n+1) = 1
  do i = 1, n
    if (s(i:i) == "<") then
      f(i) = 1
    else
      f(i) = -1
    end if
  end do
  do i = 1, n+1
    if (f(i-1) == 1) then
      a(i) = a(i-1)+1
    end if
  end do
  do i = n, 0, -1
    if (f(i) == -1) then
      a(i) = max(a(i),a(i+1)+1)
    end if
  end do
  write(*,'(i0)') sum(int(a(1:n+1),8))
end program gt_lt