program main implicit none integer::N,K integer::i,j integer,allocatable::num(:) !number of soinsu read *,N,K allocate(num(N)) num = 0 do i=2,N if(num(i).eq.0) then !sosuu do j=i,N,i num(j) = num(j) + 1 end do end if end do print '(i0)',COUNT(num(2:N).ge.K) end program main