program slimes
  implicit none
  integer :: n
  character(:),allocatable :: S
  character,allocatable :: a(:)
  integer :: i,count

  read(*,*) n
  allocate(character(n)::S)
  allocate(a(n))


  read(*,*) S
  
  do i =1,n
     read(S(i:i),*) a(i)
  end do 
  
  count = 1
  do i = 2,n
     if(a(i).ne.a(i-1))then
        count = count +1
     end if
!     print*,a(i),count
  end do
  write(*,*) count
  
end program slimes
