program slimes
    implicit none
    integer(4):: n,count=1
    character(:),allocatable:: s

    read*,n
    allocate(character(n):: s)
    read*,s

    block; integer(4):: i
        do i=2, n
            if (s(i-1:i-1) /= s(i:i)) count=count+1
        end do
    end block
    
    print*, count
end program slimes