program main implicit none integer::N,i,j integer,allocatable::A(:) integer::B(0:2**15-1) read *,N allocate(A(N)) read *,A B = 0 B(0) = 1 do i=1,N do j=0,2**15-1 B(IOR(A(i),j))=B(j) end do end do print '(i0)', COUNT(B.eq.1) end program main