program slimes
  implicit none
  integer :: n, i = 1, j = 1, m = 0
  character(100001) :: s = ""
  read(*,*) n
  read(*,*) s
  s(n+1:n+1) = "X"
  do while (i <= n)
    do while (s(j:j) == s(i:i))
      j = j+1
    end do
    m = m+1
    i = j
  end do
  write(*,'(i0)') m
end program slimes