program main implicit none integer ::n,pow=0,a(1:3),num(1:10)=0 integer i,j read(*,*)n do i=1,n read(*,*)a(1:3) do j=1,3 num(a(j))=num(a(j))+1 enddo enddo do i=1,10 do while(num(i)>=2) pow=pow+1 num(i)=num(i)-2 enddo enddo if(sum(num)>=8)then pow=pow+2 elseif(sum(num)>=4)then pow=pow+1 endif write(*,*)pow end program