implicit none integer(8) i,N,j,c integer(8),allocatable :: A(:) integer(8),allocatable :: B(:) read(*,*) N allocate (A(1:N)) allocate (B(1:N)) A=0 B=0 c=0 read(*,*) (A(i),i=1,N) do i=1,N-1 if (A(i)==A(i+1)) then B(i)=B(i)-1 B(i+1)=B(i+1)-1 end if end do do i=1,N if (B(i)==0) then c=c+1 end if end do write(*,*) c end