implicit none integer(8) i,n,m,j,a,b integer(8),allocatable :: x(:,:) integer(8),allocatable :: y(:) read(*,*) n allocate (x(1:n,1:3)) allocate (y(1:10)) x=0 y=0 a=0 b=0 do i=1,n read(*,*) (x(i,m),m=1,3) do j=1,3 y(x(i,j))=y(x(i,j))+1 end do end do do i=1,11 if (y(i) >= 2) then do while (y(i) > 1) a = a+1 y(i)=y(i)-2 end do end if end do do i=1,11 if (y(i) >=1 ) then b=b+1 end if end do b=b/4 write(*,*) a+b end