program main
 implicit none
 character*1 A,B
 integer N,k,i
 
 read(*,*) N
 read(*, '(A1)', advance='no' ) A 
 
 k=1
 do i=2,N
  read(*, '(A1)', advance='no' ) B
  if (A/=B) then
   k = k+1
  end if
  A = B
 end do
 
 write(*,*) k
end program main