program main implicit none integer(8)::N,flg,i,ans=0 integer(8),allocatable::A(:),B(:) read*,N allocate(A(N)) allocate(B(N)) read*,A,B flg=0 do i=1,N if(A(i)/=B(i))then if(flg==0)then flg=1 ans=ans+1 end if else flg=0 end if end do print'(i0)',ans end program main