Vasya and Petya are playing a simple game. Vasya thought of number x between 1 and n, and Petya tries to guess the number.

Petya can ask questions like: "Is the unknown number divisible by number y?".

The game is played by the following rules: first Petya asks all the questions that interest him (also, he can ask no questions), and then Vasya responds to each question with a 'yes' or a 'no'. After receiving all the answers Petya should determine the number that Vasya thought of.

Unfortunately, Petya is not familiar with the number theory. Help him find the minimum number of questions he should ask to make a guaranteed guess of Vasya's number, and the numbers y_{i}, he should ask the questions about.


-----Input-----

A single line contains number n (1 ≤ n ≤ 10^3).


-----Output-----

Print the length of the sequence of questions k (0 ≤ k ≤ n), followed by k numbers — the questions y_{i} (1 ≤ y_{i} ≤ n).

If there are several correct sequences of questions of the minimum length, you are allowed to print any of them.


-----Examples-----
Input
4

Output
3
2 4 3 

Input
6

Output
4
2 4 3 5 



-----Note-----

The sequence from the answer to the first sample test is actually correct.

If the unknown number is not divisible by one of the sequence numbers, it is equal to 1.

If the unknown number is divisible by 4, it is 4.

If the unknown number is divisible by 3, then the unknown number is 3.

Otherwise, it is equal to 2. Therefore, the sequence of questions allows you to guess the unknown number. It can be shown that there is no correct sequence of questions of length 2 or shorter.

Difficulty: MEDIUM

Solutions:
P = print
R = range
n = int(input())
x = ' '.join([' '.join((str(j ** i) for i in R(1, 11) if j ** i <= n)) for j in R(2, n + 1) if 0 == sum((j % i == 0 for i in R(2, j)))])
P(len(x.split()))
P(x)


n = int(input())
divs = []
primes = []
p = 2
while p <= n:
	isP = True
	for p2 in primes:
		if p2 * p2 > p:
			break
		if p % p2 == 0:
			isP = False
			break
	if not isP:
		p += 1
		continue
	primes.append(p)
	ma = p
	while ma <= n:
		divs.append(ma)
		ma *= p
	p += 1
print(len(divs))
print(*divs)


entrada = int(input())
i = 2
array = [''] * 1005
arr = [''] * 1005
cont = 0
valor = 0
s = 0

def teste(entrada):
	i = 2
	while i * i <= int(entrada):
		if entrada % i == 0:
			return False
		i += 1
	return True
while i < 1005:
	if teste(i):
		array[cont] = i
		cont += 1
	i += 1
for i in range(cont):
	valor = array[i]
	while valor <= entrada:
		arr[s] = valor
		s += 1
		valor = valor * array[i]
	i += 1
print(s)
result = ''
for i in range(s):
	result += str(arr[i]) + ' '
print(result)


import math
numero = int(input())
dados = {}
for i in range(numero + 1):
	dados[i] = False
for i in range(2, numero + 1):
	if dados[i] == False:
		potencia = 2
		while i * potencia <= numero:
			dados[i * potencia] = True
			potencia += 1
primos = []
for i in dados:
	if i != 0 and i != 1 and (dados[i] == False):
		primos.append(i)
perguntas = []
for primo in primos:
	potencia = 1
	while primo ** potencia <= numero:
		perguntas.append(primo ** potencia)
		potencia += 1
print(len(perguntas))
print(*perguntas)


def main():
	n = int(input()) + 1
	(a, res) = ([True] * n, [])
	for p in range(2, n):
		if a[p]:
			pp = 1
			while pp * p < n:
				pp *= p
				res.append(pp)
			a[p:n:p] = [False] * ((n - 1) // p)
	print(len(res))
	print(*res)
main()


def crivo():
	n = 10000
	pr = [True] * (n + 1)
	pr[0] = pr[1] = False
	for i in range(2, n + 1):
		if pr[i] and i * i <= n:
			for j in range(i * i, n + 1, i):
				pr[j] = False
	return pr
l = crivo()
pr = []
for i in range(len(l)):
	if l[i]:
		pr.append(i)
n = int(input())
res = []
i = 0
while pr[i] <= n:
	k = pr[i]
	while k <= n:
		res.append(k)
		k = k * pr[i]
	i += 1
print(len(res))
print(' '.join([str(i) for i in res]))


import itertools

def erat2():
	D = {}
	yield 2
	for q in itertools.islice(itertools.count(3), 0, None, 2):
		p = D.pop(q, None)
		if p is None:
			D[q * q] = q
			yield q
		else:
			x = p + q
			while x in D or not x & 1:
				x += p
			D[x] = p

def get_primes_erat(n):
	return list(itertools.takewhile(lambda p: p < n, erat2()))
n = int(input())
x = get_primes_erat(n + 1)
a = []
for i in x:
	N = 1
	while i ** N <= n:
		a.append(i ** N)
		N += 1
print(len(a))
for i in a:
	print(i, end=' ')


n = int(input())
if n == 1:
	print(0)
	exit(0)
elif n == 2:
	print(1)
	print(2)
	exit(0)
ans = 0
pr = [0] * (n + 1)
p = []
end = 1
while end > 0:
	i = 2
	while pr[i] != 0:
		i += 1
		if i == n + 1:
			end = 0
			break
	if i != n + 1:
		pr[i] = 1
		p.append(i)
	j = i
	while i + j <= n:
		i += j
		pr[i] = 2
res = []
for a in p:
	x = a
	while x <= n:
		res.append(x)
		ans += 1
		x *= a
print(ans)
print(*res)


n = int(input())
ans = []
isprime = [True] * 1001
(isprime[0], isprime[1]) = (False, False)
for i in range(2, n + 1):
	if isprime[i]:
		for j in range(i * i, n + 1, i):
			isprime[j] = False
for i in range(2, n + 1):
	if isprime[i]:
		ans += [int(pow(i, x)) for x in range(1, 10) if int(pow(i, x)) <= n]
print(len(ans))
print(*ans)


def sieve(a, b):
	m = []
	if b != 1:
		if a == 1:
			a += 1
		primes = [1] * (b + 1)
		primes[0] = 0
		primes[1] = 0
		for i in range(2, b + 1):
			if primes[i] == 1:
				for j in range(2 * i, b + 1, i):
					primes[j] = 0
		for i in range(a, b + 1):
			if primes[i] == 1:
				m.append(i)
		return m
	elif a == 1 and b == 1:
		return
n = int(input())
k = 0
ans = []
if n == 1:
	print(k)
else:
	mas = sieve(2, n)
	for i in mas:
		j = i
		ans.append(j)
		k += 1
		while n >= j * i:
			j *= i
			ans.append(j)
			k += 1
	print(k)
	print(*ans)


n = int(input())
ans = []
p = [0] * (n + 1)
for i in range(2, n):
	if p[i] == 0:
		for j in range(2 * i, n + 1, i):
			p[j] = 1
primes = []
for i in range(2, n + 1):
	if p[i] == 0:
		primes.append(i)
for i in primes:
	c = 1
	while i ** c <= n:
		ans.append(i ** c)
		c += 1
print(len(ans))
print(*ans)


def gerap(MAX):
	MAX += 1
	resposta = []
	primos = [True] * MAX
	primos[0] = False
	primos[1] = False
	for i in range(2, MAX, 1):
		if primos[i]:
			elevado = 1
			while elevado * i < MAX:
				elevado *= i
				resposta.append(str(elevado))
			for j in range(i * 2, MAX, i):
				primos[j] = False
	return resposta
a = int(input())
primos = gerap(a)
print(len(primos))
print(' '.join(primos))


n = int(input())
r = []
is_prime = lambda x: x <= 10 and x in [2, 3, 5, 7] or (x > 10 and all((x % i > 0 for i in range(2, int(x ** 0.5) + 1))))
for i in range(2, n + 1):
	if not is_prime(i):
		continue
	k = i
	while k <= n:
		r.append(k)
		k *= i
print(len(r))
print(*r)


y = int(input())
a = [2]
for i in range(3, y + 1, 2):
	isprime = True
	for j in a:
		if i % j == 0:
			isprime = False
			break
	if isprime == True:
		a.append(i)
ans = []
for i in a:
	g = i
	while g <= y:
		ans.append(g)
		g = g * i
print(len(ans))
for i in ans:
	print(i, '', end='')


import os, sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter
from math import gcd
n = int(input())
bd = n
ar = [1] * (bd + 1)
for i in range(2, int(bd ** (1 / 2)) + 1):
	if ar[i] == 1:
		for j in range(i * i, bd + 1, i):
			ar[j] = 0
a = []
for i in range(2, n + 1):
	if ar[i] == 1:
		t = i
		while t <= n:
			a.append(t)
			t *= i
print(len(a))
print(*a)


import math
import sys

def crivo_de_erastotenes(entrada):
	numeros = [True] * (entrada + 1)
	raiz_meiota = int(math.sqrt(entrada))
	for j in (i for i in range(2, raiz_meiota + 1) if numeros[i]):
		for k in range(j * j, entrada + 1, j):
			numeros[k] = False
	return [i for i in range(2, entrada + 1) if numeros[i]]

def resolucao(numero):
	sim = []
	for i in crivo_de_erastotenes(numero):
		sim.append(i)
		atual = i * i
		while atual <= numero:
			sim.append(atual)
			atual *= i
	return sim

def print_stderr(*args, **kwargs):
	print(*args, file=sys.stderr, **kwargs)
entrada = int(input())
resposta = resolucao(entrada)
print(len(resposta))
print(' '.join((str(i) for i in resposta)))


def prime(x):
	i = 2
	while i * i <= x:
		if x % i == 0:
			return False
		i += 1
	return True
n = int(input())
ans = []
for i in range(2, n + 1):
	if not prime(i):
		continue
	k = i
	while k <= n:
		ans.append(k)
		k *= i
print(len(ans))
print(*ans)


n = int(input())
p = []
for i in range(2, n + 1):
	isprime = True
	for j in p:
		if i % j == 0:
			isprime = False
			break
	if isprime:
		p.append(i)
ans = []
for i in p:
	k = 1
	while i ** k <= n:
		ans.append(str(i ** k))
		k += 1
print(len(ans))
print(' '.join(ans))


from math import log, floor
t = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
n = int(input())
ans = []
for i in t:
	if i > n:
		break
	for a in range(1, floor(log(n, i)) + 1):
		ans.append(i ** a)
print(len(ans))
print(*ans)


n = int(input())
z = []
t = [False for i in range(n + 1)]
for i in range(1, n + 1):
	k = 0
	for j in range(1, i + 1):
		if i % j == 0:
			k += 1
	if k == 2:
		t[i] = True
for i in range(1, n + 1):
	if t[i]:
		k = 1
		v = i
		while v <= n:
			z += [v]
			v *= i
print(len(z))
for i in range(len(z)):
	print(z[i], end=' ')


__author__ = 'dwliv_000'

def isPrime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
z = []
for c in range(2, n + 1):
	if isPrime(c):
		for j in range(1, 11):
			if c ** j <= n:
				z.append(c ** j)
print(len(z))
for j in range(len(z)):
	print(z[j], end=' ')


def eratosthenes():
	sieve = list(range(n + 1))
	sieve[1] = 0
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sieve
n = int(input())
a = eratosthenes()
res = []
for elem in a:
	if elem == 0:
		continue
	x = elem
	while x <= n:
		res.append(x)
		x *= elem
print(len(res))
print(' '.join(list(map(str, res))))


n = int(input())
quest = []
for i in range(2, n + 1):
	if all((i % q != 0 for q in quest)):
		x = i
		while x <= n:
			quest.append(x)
			x *= i
print(len(quest))
print(' '.join((str(q) for q in quest)))


def get_primes(k):
	p = [True] * (k + 1)
	p[0] = False
	p[1] = False
	for i in range(1, k + 1):
		if p[i]:
			for j in range(2, k // i + 1):
				p[i * j] = False
	pr = []
	for i in range(k + 1):
		if p[i]:
			pr.append(i)
	return pr
n = int(input())
p = get_primes(n + 2)
from math import log, floor
s = 0
b = []
for x in p:
	k = floor(log(n) / log(x))
	s += k
	for i in range(1, k + 1):
		b.append(int(x ** i))
print(int(s))
for x in b:
	print(x, end=' ')
print()


from sys import stdin

def main():
	n = int(stdin.readline())
	check = [True] * 1001
	check[0] = False
	check[1] = False
	index = 2
	while index * index <= 1000:
		if check[index]:
			for j in range(index * index, 1001, index):
				check[j] = False
		index += 1
	prime = []
	for i in range(2, 1001):
		if check[i]:
			prime.append(i)
	ans = []
	count = 0
	for i in range(len(prime)):
		if prime[i] <= n:
			curr = prime[i]
			while curr <= n:
				count += 1
				ans.append(curr)
				curr = curr * prime[i]
		else:
			break
	print(count)
	print(*ans)
main()


from sys import stdin
input = stdin.readline

def is_prime(x):
	if x == 2 or x == 3:
		return True
	if x % 2 == 0:
		return False
	i = 1
	while i ** 2 <= x:
		i += 2
		if x % i == 0:
			return False
	return True
n = int(input())
ans = []
for i in range(2, n + 1):
	if is_prime(i):
		p = i
		ans.append(p)
		while p <= n // i:
			p *= i
			ans.append(p)
print(len(ans))
print(*ans)


is_prime = lambda n: all((n % d for d in range(2, int(n ** 0.5) + 1)))
(n, Y) = (int(input()), [])
for i in range(2, n + 1):
	if is_prime(i):
		y = i
		while y <= n:
			Y.append(y)
			y *= i
print(len(Y))
print(*Y)


def is_prime(n):
	for i in range(2, n):
		if n % i == 0:
			return 0
			break
	return 1
n = int(input())
if n == 1:
	print(0)
else:
	q = []
	for i in range(2, n + 1):
		if is_prime(i):
			q.append(i)
			k = i
			while 1:
				k = k * i
				if k <= n:
					q.append(k)
				else:
					break
	print(len(q))
	for i in q:
		print(i, end=' ')


def easy(n):
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
if n == 1:
	print(0)
else:
	ans = []
	for i in range(2, n + 1):
		if easy(i):
			j = i
			while j <= n:
				ans.append(j)
				j *= i
	print(len(ans))
	print(*ans)


n = int(input())

def check(x, y):
	while x % y == 0:
		x /= y
	if x == 1:
		return True
	else:
		return False
aux = [0] * 10 ** 4
res = []
count = 0
for i in range(2, n + 1):
	if aux[i] == 0:
		count += 1
		res.append(i)
		j = 2
		while i * j <= n:
			if check(j, i):
				count += 1
				res.append(j * i)
			aux[j * i] = 1
			j += 1
print(count)
print(*res)


import sys
from collections import defaultdict

def primeSieve(n):
	cache = defaultdict(list)
	cache[2].append(2)
	primes = [2]
	for i in range(2, n + 1):
		if i in cache:
			for ele in cache[i]:
				cache[i + ele].append(ele)
			del cache[i]
		else:
			primes.append(i)
			cache[i + i].append(i)
	return primes

def solve(n):
	questions = 0
	questionList = []
	primes = primeSieve(n)
	for prime in primes:
		power = 1
		k = prime ** power
		while k <= n:
			questionList.append(k)
			power += 1
			k = prime ** power
	questions = len(questionList)
	return (questions, questionList)

def readinput():
	k = int(input())
	(ans, lst) = solve(k)
	print(ans)
	for i in range(len(lst)):
		if i != len(lst) - 1:
			print(lst[i], end=' ')
		else:
			print(lst[i], end='\n')
readinput()


n = int(input())
s_p = set((i for i in range(2, n + 1)))
for i in range(2, int(n ** (1 / 2)) + 1):
	if i in s_p:
		for j in range(2, n // i + 1):
			if i * j in s_p:
				s_p.remove(i * j)
l_o = list()
for i in s_p:
	c_e = i
	while i <= n:
		l_o.append(i)
		i *= c_e
print(len(l_o))
print(' '.join((str(x) for x in l_o)))


n = int(input())
is_prime = [True] * (n + 1)
primes = []
for i in range(2, n + 1):
	if is_prime[i]:
		primes.append(i)
		for j in range(i + i, n + 1, i):
			is_prime[j] = False
output = ''
num = 0
for prime in primes:
	prime_calc = prime
	while prime_calc <= n:
		num += 1
		output += str(prime_calc) + ' '
		prime_calc *= prime
print(num)
print(output)


import math
n = int(input())
m = 1
ans = []

def is_prime(number):
	for i in range(2, int(math.sqrt(number)) + 1):
		if number % i == 0:
			return False
	return True
for el in range(2, n + 1):
	if is_prime(el):
		candidate = el
		while candidate <= n:
			ans.append(str(candidate))
			candidate *= el
print(len(ans))
print(' '.join(ans))


n = int(input())
questions = []
for i in range(2, n + 1):
	l = list((i % q for q in questions))
	if all(l):
		x = i
		while x <= n:
			questions.append(x)
			x *= i
print(len(questions))
print(' '.join((str(q) for q in questions)))


def is_prime(n):
	if n == 2:
		return True
	elif n < 2 or n % 2 == 0:
		return False
	elif all((n % i != 0 for i in range(3, int(n ** 0.5) + 1, 2))):
		return True
	return False
(n, t, l) = (int(input()), 0, [])
for x in range(2, n + 1):
	if is_prime(x):
		k = 1
		while x ** k <= n:
			l.append(str(x ** k))
			k += 1
			t += 1
print(t, ' '.join(l), sep='\n')


import math
import sys
import collections
import bisect
import string
import time

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	ans = []
	for p in range(n + 1):
		if prime[p]:
			ans.append(p)
	return ans
for tc in range(1):
	n = int(input())
	primes = SieveOfEratosthenes(n)
	ans = []
	for i in primes:
		no = i
		power = 1
		while no ** power <= n:
			ans.append(no ** power)
			power += 1
	print(len(ans))
	print(*ans)


import unittest
import sys

class Game:

	def __init__(self, test_inputs=None):
		it = iter(test_inputs.split('\n')) if test_inputs else None

		def uinput():
			return next(it) if it else sys.stdin.readline().rstrip()
		[self.n] = map(int, uinput().split())
		self.sieve(self.n)

	def sieve(self, n):
		self.pf = [0] * (n + 1)
		i = 2
		while i * i <= n:
			if self.pf[i] == 0:
				j = i * i
				while j <= n:
					self.pf[j] = i
					j += i
			i += 1

	def factorize(self, n):
		result = {}
		while n > 1:
			pf = self.pf[n]
			if pf == 0:
				pf = n
			if pf not in result.keys():
				result[pf] = 0
			result[pf] += 1
			n = n // pf
		return result

	def calculate(self):
		result = []
		for (i, k) in enumerate(self.pf):
			if k != 0 or i < 2:
				continue
			cur = i
			while cur <= self.n:
				result.append(cur)
				cur *= i
		return str(len(result)) + '\n' + ' '.join(map(str, result))

class unitTests(unittest.TestCase):

	def test_single_test(self):
		test = '4'
		d = Game(test)
		self.assertEqual(d.n, 4)
		d = Game('1000')
		self.assertEqual(d.pf[:5], [0, 0, 0, 0, 2])
		self.assertEqual(d.factorize(40), {2: 3, 5: 1})
		self.assertEqual(Game(test).calculate(), '3\n2 4 3')
		test = '6'
		self.assertEqual(Game(test).calculate(), '4\n2 4 3 5')
		test = ''
		test = ''

	def time_limit_test(self, nmax):
		import random
		import timeit
		test = str(nmax) + ' ' + str(nmax) + '\n'
		numnums = [str(i) + ' ' + str(i + 1) for i in range(nmax)]
		test += '\n'.join(numnums) + '\n'
		nums = [random.randint(1, 10000) for i in range(nmax)]
		test += ' '.join(map(str, nums)) + '\n'
		start = timeit.default_timer()
		d = Game(test)
		calc = timeit.default_timer()
		d.calculate()
		stop = timeit.default_timer()
		print('\nTimelimit Test: ' + '{0:.3f}s (init {1:.3f}s calc {2:.3f}s)'.format(stop - start, calc - start, stop - calc))
sys.setrecursionlimit(100000)
if sys.argv[-1] == '-ut':
	unittest.main(argv=[' '])
sys.stdout.write(Game().calculate())


def SieveOfEratosthenes(n, ans):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n):
		if prime[p]:
			ans.append(p)
n = int(input())
prime = []
ans = []
SieveOfEratosthenes(n + 1, prime)
for i in prime:
	k = 1
	pow = i
	while pow <= n:
		ans.append(str(pow))
		k += 1
		pow = i ** k
print(len(ans))
print(' '.join(ans))


import math
import array

def is_prime(x):
	i = 2
	while i <= math.sqrt(x):
		if x % i == 0:
			return False
		i = i + 1
	return True
answer_list = []
n = int(input())
i = 2
answer = 0
while i <= n:
	if is_prime(i):
		answer = answer + 1
		answer_list.append(i)
		j = i * i
		while j <= n:
			answer = answer + 1
			answer_list.append(j)
			j = j * i
	i = i + 1
print(answer)
for x in answer_list:
	print(x, end=' ')


n = int(input())
primos = []
composto = [False] * (10 ** 3 + 7)
for i in range(2, 10 ** 2, 1):
	if not composto[i]:
		for j in range(i + i, 10 ** 3 + 7, i):
			composto[j] = True
for i in range(2, 10 ** 3 + 7, 1):
	if not composto[i]:
		primos.append(i)
ans = []
for p in primos:
	if p > n:
		break
	i = 1
	while p ** i <= n:
		ans.append(p ** i)
		i += 1
print(len(ans))
for num in ans:
	print(num, end=' ')
exit(0)


from math import sqrt
from math import sqrt

def crivo(DIM):
	lim = int(sqrt(DIM)) + 1
	vals = [True] * DIM
	vals[0] = False
	vals[1] = False
	for i in range(2, lim):
		if vals[i]:
			for j in range(i * i, DIM, i):
				vals[j] = False
	return [i for i in range(len(vals)) if vals[i]]
num = int(input())
primos = crivo(num + 1)
ans = []
for e in primos:
	ans.append(str(e))
	atual = e * e
	while atual <= num:
		ans.append(str(atual))
		atual *= e
print(len(ans))
print(' '.join(ans))


n = int(input())
prime = [False] * (n + 1)
ans = []
for i in range(2, n + 1):
	if prime[i]:
		continue
	x = i
	while x <= n:
		ans.append(x)
		prime[x] = True
		x *= i
	x = i
	while x <= n:
		prime[x] = True
		x += i
print(len(ans))
for x in ans:
	print(x, end=' ')


def is_pri(n):
	f = 0
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			f = 1
			break
	if f == 0:
		return True
	else:
		return False

def pri(n):
	r = []
	for i in range(2, n + 1):
		if is_pri(i) == True:
			r.append(i)
	return r
n = int(input())
a = pri(n)
r = []
for i in a:
	j = 1
	while i ** j <= n:
		r.append(i ** j)
		j = j + 1
print(len(r))
for i in r:
	print(str(i) + ' ', end='')


import sys
from copy import *
from bisect import *

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def bo(i):
	return ord(i) - ord('A')

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def isvalid(i, j):
	return 0 <= i < n and 0 <= j < m and (a[i][j] != '.')

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = 1

def prime(p):
	for i in range(2, p):
		if p % i == 0:
			return False
	return True
while t > 0:
	t -= 1
	n = fi()
	ans = []
	for p in range(2, n + 1):
		if prime(p):
			i = p
			while i <= n:
				ans.append(i)
				i *= p
	print(len(ans))
	print(*ans)


def is_prime(x):
	i = 2
	while i * i <= x:
		if x % i == 0:
			return False
		i += 1
	return True

def primes():
	i = 2
	while True:
		if is_prime(i):
			yield i
		i += 1
import itertools
n = int(input())
guesses = []
for p in itertools.takewhile(lambda p: p <= n, primes()):
	x = p
	while x <= n:
		guesses.append(x)
		x *= p
print(len(guesses))
print(' '.join(map(str, guesses)))


def sieve(n):
	prime = [True] * (n + 1)
	prime[0] = prime[1] = False
	i = 2
	while i * i <= n:
		if prime[i]:
			for j in range(i * i, n + 1, i):
				prime[j] = False
		i += 1
	return prime
n = int(input())
isPrime = sieve(n)
ret = []
for i in range(n + 1):
	if isPrime[i]:
		p = 1
		while i ** p <= n:
			ret.append(i ** p)
			p += 1
print('%d\n%s' % (len(ret), ' '.join(map(str, ret))))


import math
n = int(input())
tt = n

def prime(n):
	if n < 2:
		return []
	ans = []
	s = [i + 2 for i in range(n - 1)]
	k = math.sqrt(n)
	p = 0
	value = 0
	while s[value] <= k:
		p = value
		while p <= n - 1:
			p = p + s[value]
			if p < len(s):
				s[p] = -1
		i = 0
		while i < len(s):
			if s[i] != -1 and i > value:
				value = i
				break
			i += 1
	for i in s:
		if i != -1:
			ans.append(i)
	return ans
s = prime(n)
i = 0
if len(s) == 0:
	print(0)
else:
	ans = 0
	array = []
	for pr in s:
		ppol = pr
		while pr <= tt:
			array.append(pr)
			pr = pr * ppol
			ans += 1
	print(ans)
	for i in array:
		print(i, end=' ')


def isPrime(m):
	for j in range(2, int(m ** 0.5) + 1):
		if m % j == 0:
			return False
	return True
n = int(input())
count = 0
mas = []
for i in range(2, n + 1):
	if isPrime(i):
		step = 1
		while i ** step <= n:
			count += 1
			mas.append(i ** step)
			step += 1
print(count)
print(*mas)


n = int(input())

def prime(n):
	i = 3
	if n == 2:
		return True
	if n % 2 == 0:
		return False
	while i * i <= n:
		if n % i == 0:
			return False
		i += 2
	return True
pr = [i for i in range(2, n + 1) if prime(i)]
prm = []
for p in pr:
	x = p
	prm.append(x)
	while True:
		x *= p
		if x > n:
			break
		prm.append(x)
print(len(prm))
print(*prm)


import math
arr = []

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	for p in range(n + 1):
		if prime[p]:
			arr.append(p)
n = int(input())
SieveOfEratosthenes(n)
final = []
for i in arr:
	x = int(math.log(n, i))
	for j in range(1, x + 1):
		final.append(pow(i, j))
print(len(final))
print(*final)


n = int(input())
primos = [1] * (n + 1)
(primos[0], primos[1]) = (0, 0)
for i in range(2, n + 1):
	if primos[i] == 1:
		for j in range(i * i, n + 1, i):
			primos[j] = 0
lista = []
for i in range(2, n + 1):
	if primos[i]:
		num = i
		while num <= n:
			lista.append(num)
			num = num * i
print(len(lista))
print(*lista)


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
n = int(input())
if n == 1:
	print(0)
	exit()
isPrime = sieve(n + 1)
ans = []
for i in range(2, n + 1):
	if isPrime[i]:
		k = i
		while k <= n:
			ans.append(k)
			k *= i
print(len(ans))
print(*ans)


from math import log
n = int(input())
primes = [True for i in range(n + 1)]
i = 2
while i * i <= n:
	if primes[i] == True:
		for j in range(i * 2, n + 1, i):
			primes[j] = False
	i += 1
l = []
s = 0
for p in range(2, n + 1):
	if primes[p] == True:
		k = int(log(n) / log(p))
		s += k
		for m in range(1, k + 1):
			l.append(p ** m)
print(s)
print(*l)


def crivo(numero):
	numeros = [True] * (numero + 1)
	raiz = int(pow(numero, 1 / 2))
	for j in (i for i in range(2, raiz + 1) if numeros[i]):
		for k in range(j * j, numero + 1, j):
			numeros[k] = False
	return [i for i in range(2, numero + 1) if numeros[i]]

def resolucao(numero):
	sim = []
	for i in crivo(numero):
		sim.append(i)
		atual = i * i
		while atual <= numero:
			sim.append(atual)
			atual *= i
	return sim
numero = int(input())
sequencia = resolucao(numero)
print(len(sequencia))
print(' '.join((str(i) for i in sequencia)))


n = int(input())
prostie = []
for i in range(1, n + 1):
	if i == 1:
		continue
	k = 2
	flag = True
	while k * k <= i:
		if i % k != 0:
			k += 1
		else:
			flag = False
			break
	if flag:
		prostie.append(i)
cnt = 0
out = []
for i in range(len(prostie)):
	a = prostie[i]
	summ = a
	while summ <= n:
		out.append(summ)
		summ = summ * a
		cnt += 1
print(cnt)
print(*out)


import math
isprime = [0] * 1000010
prime = []

def seive():
	isprime[1] = isprime[0] = 1
	prime.append(2)
	limit = int(math.sqrt(1000010)) + 2
	for i in range(4, 1000010, 2):
		isprime[i] = 1
	for i in range(3, 1000010, 2):
		if not isprime[i]:
			prime.append(i)
			if i <= limit:
				for j in range(i * i, 1000010, i * 2):
					isprime[j] = 1
seive()
n = int(input())
output_list = []
index = 0
while prime[index] <= n:
	p = 1
	x = pow(prime[index], p)
	while x <= n:
		output_list.append(x)
		p += 1
		x = pow(prime[index], p)
	index += 1
print(len(output_list))
for x in output_list:
	print(x, end=' ')
print()


n = int(input())
pr = {}
for i in range(2, n + 1):
	pr[i] = True
prime = []
for i in range(2, n + 1):
	if pr[i]:
		prime.append(i)
		for j in range(2 * i, n + 1, i):
			pr[j] = False
ans = []
for i in prime:
	j = i
	while j <= n:
		ans.append(j)
		j = j * i
print(len(ans))
print(*ans)


def gen_prime():
	num = [0 for i in range(10 ** 3 + 1)]
	num[2] = 1
	num[3] = 1
	for i in range(4, 10 ** 3 + 1):
		isprime = True
		for j in range(2, int(i ** 0.5) + 1):
			if num[j]:
				if not i % j:
					isprime = False
					break
		if isprime:
			num[i] = 1
	prime = []
	for i in range(2, 10 ** 3 + 1):
		if num[i]:
			prime.append(i)
	return prime
import sys

def inp():
	return sys.stdin.readline().strip()
t = 1
for _ in range(t):
	n = int(input())
	primes = gen_prime()
	ans = []
	a = 0
	for i in primes:
		a = 1
		ii = i
		while ii <= n:
			ans.append(ii)
			ii = ii * i
	print(len(ans))
	print(*ans)


from math import ceil
n = int(input())
prime_arr = [0] * 1001
prime_arr[2] = 1
ans = []
for i in range(3, n + 1):
	prime = True
	for j in range(2, ceil(i ** 0.5) + 1):
		if i % j == 0:
			prime = False
	if prime:
		prime_arr[i] = 1
i = 2
while i <= n:
	if prime_arr[i] == 1:
		k = 1
		while i ** k <= n:
			ans.append(i ** k)
			k += 1
	i += 1
print(len(ans))
print(' '.join(map(str, ans)))


import math

def isPrime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
if n == 1:
	print(0)
else:
	primelist = []
	for i in range(2, n + 1):
		if isPrime(i):
			primelist.append(i)
	numguesses = 0
	guesses = []
	for p in primelist:
		check = p
		while check <= n:
			guesses.append(check)
			numguesses += 1
			check *= p
	print(numguesses)
	for x in guesses:
		print(x, end=' ')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

class Prime:

	def __init__(self, n):
		self.M = m = int(math.sqrt(n)) + 10
		self.A = a = [True] * m
		a[0] = a[1] = False
		self.T = t = []
		for i in range(2, int(math.sqrt(m)) + 1):
			if not a[i]:
				continue
			t.append(i)
			for j in range(i * i, m, i):
				a[j] = False
		self.ds_memo = {}
		self.ds_memo[1] = set([1])

	def is_prime(self, n):
		return self.A[n]

def main():
	n = I()
	if n == 1:
		return '0\n'
	r = []
	pr = Prime(n ** 4)
	for i in pr.T:
		if n < i:
			break
		r.append(i)
		j = i * i
		while j <= n:
			r.append(j)
			j *= i
	return '{}\n{}'.format(len(r), ' '.join(map(str, r)))
print(main())


import math
n = int(input())
ans = []
for i in range(2, n + 1):
	c = 1
	for j in range(2, int(math.sqrt(i)) + 1):
		if i % j == 0:
			c = 0
			break
	if c:
		ans.append(i)
ans2 = []
for i in ans:
	ans2.append(i)
	tem = int(math.log(n, i))
	for j in range(2, tem + 1):
		ans2.append(i ** j)
print(len(ans2))
print(*ans2)


def is_prime(n):
	if n % 2 == 0 and n != 2:
		return False
	d = 3
	while d * d < n and n % d != 0:
		d += 2
	return not n % d == 0 or n == d

def put(p):
	res.append(p)
	curr = p * p
	while curr <= n:
		res.append(curr)
		curr *= p
n = int(input())
res = []
for i in range(2, n + 1):
	if is_prime(i):
		put(i)
print(len(res))
print(' '.join(map(str, res)))


prime = []
f = [0] * 1001
f[0] = f[1] = 1
for i in range(2, 1001):
	if f[i] == 0:
		for j in range(i * i, 1001, i):
			f[j] = 1
n = int(input())
ans = []
for i in range(2, n + 1):
	if f[i] == 0:
		j = i
		while j <= n:
			ans.append(j)
			j *= i
print(len(ans))
print(*ans)


def isPrime(num):
	if num > 1:
		for i in range(2, num // 2 + 1):
			if num % i == 0:
				return False
		return True
	else:
		return False
q = int(input())
l = []
for i in range(1, q + 1):
	if isPrime(i):
		l.append(i)
count = 0
l2 = []
for each in l:
	i = 2
	temp = each
	while temp <= q:
		l2.append(temp)
		temp = each ** i
		i += 1
print(len(l2))
print(*l2)


__author__ = 'User'
n = int(input())
arr = [[] for i in range(n + 1)]
ans = []
for i in range(2, n + 1):
	if arr[i] == []:
		ans.append(i)
		c = i
		while c * i <= n:
			h = c * i
			arr[h].append(h)
			ans.append(h)
			c *= i
		for j in range(i, n + 1, i):
			arr[j].append(i)
for i in range(n):
	arr[i].sort()
print(len(ans))
print(*ans)


import math
import collections

def factorize(n):
	step = lambda x: 1 + (x << 2) - (x >> 1 << 1)
	maxq = int(math.floor(math.sqrt(n)))
	d = 1
	q = n % 2 == 0 and 2 or 3
	while q <= maxq and n % q != 0:
		q = step(d)
		d += 1
	return q <= maxq and [q] + factorize(n // q) or [n]

def primes2(limit):
	if limit < 2:
		return []
	if limit < 3:
		return [2]
	lmtbf = (limit - 3) // 2
	buf = [True] * (lmtbf + 1)
	for i in range((int(limit ** 0.5) - 3) // 2 + 1):
		if buf[i]:
			p = i + i + 3
			s = p * (i + 1) + i
			buf[s::p] = [False] * ((lmtbf - s) // p + 1)
	return [2] + [i + i + 3 for (i, v) in enumerate(buf) if v]
n = int(input())

def solve(n):
	if n == 1:
		print(0)
		return
	primes = primes2(n)
	record = {p: 0 for p in primes}
	for m in range(2, n + 1):
		facs = factorize(m)
		counts = collections.Counter(facs)
		for (p, c) in counts.items():
			if c > record[p]:
				record[p] = c
	q = sum(record.values())
	print(q)
	nums = []
	for (p, c) in record.items():
		for i in range(1, c + 1):
			nums.append(p ** i)
	if q > 0:
		print(*nums)
solve(n)


n = int(input())
isprime = [True for i in range(n + 1)]
for i in range(2, len(isprime)):
	j = i
	while i * j < len(isprime):
		isprime[i * j] = False
		j += 1
ans = []
for i in range(2, len(isprime)):
	if isprime[i]:
		j = 1
		while i * j <= n:
			ans.append(i * j)
			j *= i
print(len(ans))
print(*(x for x in ans))


n = int(input())
l = []
for i in range(2, n + 1):
	for p in l:
		if i % p == 0:
			break
	else:
		el = i
		while el <= n:
			l.append(el)
			el *= i
print(len(l))
print(' '.join([str(i) for i in l]))


n = int(input())

def is_prime(n):
	p = 2
	while p * p <= n:
		if n % p == 0:
			return False
		p += 1
	return True
assert is_prime(7)
assert is_prime(47)
assert is_prime(29)
assert not is_prime(12)
assert not is_prime(49)
asks = []
prime = 2
while prime <= n:
	k = 1
	while prime ** k <= n:
		asks.append(prime ** k)
		k += 1
	prime += 1
	while not is_prime(prime):
		prime += 1
print(len(asks))
for e in asks:
	print(e, end=' ')
print('')


n = int(input())
a = [0] * (n + 1)
b = []
for i in range(2, n + 1):
	if a[i]:
		continue
	ii = 1
	while ii * i <= n:
		ii *= i
		b += [ii]
	j = i
	while j <= n:
		a[j] = 1
		j += i
print(len(b))
print(' '.join(map(str, b)))


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass

def pmat(A):
	for ele in A:
		print(ele, end='\n')

def seive():
	prime = [1 for i in range(10 ** 3 + 1)]
	for i in range(2, 10 ** 3 + 1):
		if prime[i] == 0:
			continue
		for j in range(2 * i, 10 ** 3 + 1, i):
			prime[j] = 0
	return prime
n = L()[0]
P = seive()
primes = []
for i in range(2, n + 1):
	if P[i]:
		primes.append(i)
ans = []
for ele in primes:
	ans.append(ele)
	curr = ele * ele
	while curr <= n:
		ans.append(curr)
		curr *= ele
print(len(ans))
print(*ans)
endtime = time.time()


n = int(input())

def isprime(x):
	for i in range(2, x):
		if x % i == 0:
			return False
	else:
		return True
l = []
for i in range(2, n + 1):
	if isprime(i) == True:
		l.append(i)
l2 = []
for i in l:
	c = 1
	while i ** c <= n:
		l2.append(i ** c)
		c += 1
print(len(l2))
for i in l2:
	print(i, end=' ')


from math import log
ans = 0
n = int(input())
prost = set((i for i in range(2, n + 1)))
for i in range(2, int(n ** 0.5) + 2):
	if i in prost:
		for k in range(i * 2, n + 1, i):
			prost.discard(k)
for i in prost:
	ans += int(log(n, i))
print(ans)
for i in prost:
	k = i
	while n >= i:
		print(i, end=' ')
		i = i * k


def calculate(n):
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True
n = int(input())
(num, count) = (0, 0)
primes = [0] * 1005
ans = [0] * 1005
for i in range(2, 1005):
	if calculate(i):
		primes[num] = i
		num += 1
for i in range(0, num):
	aux = primes[i]
	while aux <= n:
		ans[count] = aux
		count += 1
		aux *= primes[i]
print(count)
answear = ''
space = False
for i in range(0, count):
	if space:
		answear += ' '
	space = True
	answear += str(ans[i])
print(answear)


prime_core = [True for i in range(1001)]
p = 2
while p * p <= 1000:
	if prime_core[p] == True:
		for i in range(p * p, 1001, p):
			prime_core[i] = False
	p += 1
primos = [int(i) for i in range(2, 1001) if prime_core[i]]
n = int(input())
fatores = []
for p in primos:
	pot = p
	if pot > n:
		break
	while pot <= n:
		fatores.append(pot)
		pot *= p
print(len(fatores))
for f in fatores:
	if f == fatores[-1]:
		print(f)
	else:
		print(f, end=' ')


n = int(input())
l = []
for i in range(2, n + 1):
	c = 0
	for x in l:
		if i % x == 0:
			c = 1
			break
	if c == 0:
		v = i
		r = v
		while v <= n:
			l.append(v)
			v = r * v
print(len(l))
print(*l)


n = int(input())
a = [True] * (n + 1)
r = []
for i in range(2, n + 1):
	if a[i]:
		j = i
		while j <= n:
			a[j] = False
			j += i
		j = i
		while j <= n:
			r.append(j)
			j *= i
print(len(r))
print(*r)


n = int(input())

def is_prime(n):
	p = 2
	while p * p <= n:
		if n % p == 0:
			return False
		p += 1
	return True
asks = []
prime = 2
while prime <= n:
	k = 1
	while prime ** k <= n:
		asks.append(prime ** k)
		k += 1
	prime += 1
	while not is_prime(prime):
		prime += 1
print(len(asks))
for e in asks:
	print(e, end=' ')
print('')


n = int(input())
primes = []
for i in range(2, n + 1):
	for p in primes:
		if i % p == 0:
			break
	else:
		primes.append(i)
asks = []
for p in primes:
	i = 1
	while p ** i <= n:
		asks.append(p ** i)
		i += 1
print(len(asks))
print(' '.join(map(str, asks)))


def prime(n):
	if n == 2:
		return True
	if n < 2 or n % 2 == 0:
		return False
	i = 3
	while i * i <= n:
		if n % i == 0:
			return False
		i += 2
	return True
(n, ans) = (int(input()), [])
for i in range(2, n + 1):
	if prime(i):
		num = i
		while num <= n:
			ans.append(num)
			num *= i
print(len(ans))
print(*ans)


n = int(input())
a = [1] * (n + 1)
a[0] = 0
a[1] = 0
for i in range(2, n + 1):
	if a[i]:
		for j in range(2, n // i + 1):
			a[i * j] = 0
b = []
for i in range(n + 1):
	if a[i]:
		j = 1
		while j * i <= n:
			j *= i
			b.append(j)
print(len(b))
print(*b)


prime = [2, 3, 5, 7, 11, 13]

def create_list(n):
	nonlocal prime
	for x in range(15, n + 1, 2):
		notPrime = False
		hold = int(x ** 0.5) + 1
		for j in prime:
			if j > hold:
				break
			if x % j == 0:
				notPrime = True
				break
		if notPrime == False:
			prime.append(x)

def main():
	nonlocal prime
	mode = 'filee'
	if mode == 'file':
		f = open('test.txt', 'r')
	if mode == 'file':
		n = int(f.readline())
	else:
		n = int(input())
	create_list(n)
	k = []
	for j in range(len(prime)):
		num = prime[j]
		while num <= n:
			k.append(num)
			num *= prime[j]
		j += 1
	print(len(k))
	for i in k:
		print(i, end=' ')
	if mode == 'file':
		f.close()

def __starting_point():
	main()
__starting_point()


import math
seive = [1] * 1001
seive[0] = seive[1] = 0
for i in range(2, int(math.sqrt(1001))):
	if seive[i] == 1:
		for j in range(i * i, 1001, i):
			seive[j] = 0
n = int(input())
l = []
for i in range(2, n + 1):
	if seive[i] == 1:
		x = i
		while x <= n:
			if x not in l:
				l.append(x)
			x *= i
print(len(l))
for i in l:
	print(i, end=' ')
print()


def boleano(inteiro):
	i = 2
	while i * i <= inteiro:
		if inteiro % i == 0:
			return False
		i += 1
	return True
inteiro = int(input())
i = 2
tamanho = 1005
array = [None] * tamanho
arrayAux = [None] * tamanho
pos = 0
while i < tamanho:
	if boleano(i):
		array[pos] = i
		pos += 1
	i += 1
i = 0
aux = 0
while i < pos:
	saida = array[i]
	while saida <= inteiro:
		arrayAux[aux] = saida
		aux += 1
		saida = saida * array[i]
	i += 1
print(aux)
vaipassar = ''
for i in range(aux):
	vaipassar += str(arrayAux[i]) + ' '
print(vaipassar.strip())


n = int(input())
s = [2]
for i in range(3, n + 1, 2):
	c = True
	for j in range(3, int(i ** 0.5 + 1), 2):
		if i % j == 0:
			c = False
			break
	if c:
		s.append(i)
c = []
for j in s:
	i = j
	while i <= n:
		c.append(i)
		i *= j
print(len(c))
print(' '.join(map(str, c)))


import sys
LI = lambda : list(map(int, sys.stdin.readline().strip('\n').split()))
MI = lambda : map(int, sys.stdin.readline().strip('\n').split())
SI = lambda : sys.stdin.readline().strip('\n')
II = lambda : int(sys.stdin.readline().strip('\n'))
n = II()
check = [True] * (n + 1)
primes = []
for i in range(2, n + 1):
	if check[i]:
		primes.append(i)
		for j in range(i + i, n + 1, i):
			check[j] = False
ans = []
for p in primes:
	j = 1
	while p ** j <= n:
		ans.append(p ** j)
		j += 1
print(len(ans))
print(*ans)


from math import sqrt
n = int(input())
ans = []
my_dict = {}

def is_prime(n):
	if n == 2:
		return True
	elif n < 2:
		return False
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
for i in range(2, n + 1):
	if is_prime(i):
		j = 1
		while i ** j <= n:
			if i ** j not in my_dict:
				my_dict[i ** j] = 1
				ans.append(str(i ** j))
			j += 1
print(len(ans))
print(' '.join(ans))


def Sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
n = int(input())
A = Sieve(n)
ans = []
for i in range(2, n + 1):
	if A[i]:
		q = 1
		while q <= n // i:
			q = q * i
			ans.append(q)
print(len(ans))
print(*ans)


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
import sys
n = int(sys.stdin.readline())
ans = []
for i in range(1, n + 1):
	if isPrime(i):
		k = 1
		while n // i >= k:
			k *= i
			ans.append(k)
print(len(ans))
print(*ans)


def Prime(x):
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			return 0
	return 1
n = int(input())
ans = []
for i in range(2, n + 1):
	if Prime(i):
		ans += [str(i)]
		t = i
		while t * i <= n:
			t *= i
			ans += [str(t)]
print(len(ans))
print(' '.join(ans))


n = int(input())
sie = [1] * 1200
prms = []
sie[1] = 0
sie[0] = 0
for i in range(2, 1200):
	if sie[i]:
		for j in range(i * i, 1200, i):
			sie[j] = 0
for i in range(len(sie)):
	if sie[i]:
		prms.append(i)
ans = 0
op = []
for i in range(len(prms)):
	if prms[i] <= n:
		k = 1
		while prms[i] ** k <= n:
			op.append(prms[i] ** k)
			k += 1
			ans += 1
print(ans)
print(*op)


def seive(r):
	prime = [1 for i in range(r + 1)]
	prime[0] = 0
	prime[1] = 0
	for i in range(r + 1):
		if prime[i]:
			for j in range(2 * i, r + 1, i):
				prime[j] = 0
	return prime

def L():
	return list(map(int, input().split()))
n = int(input())
ans = []
prime = seive(n)
for i in range(n + 1):
	if prime[i]:
		num = 1
		while num <= n // i:
			num *= i
			ans.append(num)
print(len(ans))
print(*ans)


n = int(input())
if n == 1:
	print(0)
	print(*[])
else:
	prime = [1] * (n + 1)
	prime[0] = prime[1] = 0
	for i in range(2, int(n ** 0.5) + 1):
		if prime[i] == 1:
			p = 2 * i
			while p <= n:
				if prime[p] == 1:
					prime[p] = 0
				p += i
	l = []
	for i in range(2, n + 1):
		if prime[i] == 1:
			count = 1
			while i ** count <= n:
				l.append(i ** count)
				count += 1
	print(len(l))
	print(*l)


p = 10 ** 3 + 5

def Sieve():
	l = [True] * p
	i = 2
	while i * i <= p:
		if l[i]:
			for j in range(i * i, p, i):
				l[j] = False
		i += 1
	return l
isprime = Sieve()
ans = []
n = int(input())
for i in range(2, n + 1):
	if isprime[i]:
		curr = i
		while curr <= n:
			ans.append(curr)
			curr = curr * i
print(len(ans))
print(*ans)


n = int(input())

def sieve(n):
	a = [False] * (n + 1)
	s = 2
	e = int(n ** (1 / 2)) + 1
	for i in range(s, e):
		if a[i] == False:
			for j in range(i * i, n + 1, i):
				a[j] = True
	li = []
	for i in range(2, n + 1):
		if not a[i]:
			temp = i
			while temp <= n:
				li.append(temp)
				temp *= i
	return li
ans = sieve(n)
print(len(ans))
print(*ans)


def pr(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
n = int(input())
l = pr(n)
l2 = []
for i in range(2, n + 1):
	if l[i]:
		a = 1
		while a * i <= n:
			a *= i
			l2.append(a)
print(len(l2))
print(*l2)


def main():
	n = int(input())
	result = []
	for i in range(2, n + 1):
		j = 2
		while j * j <= i:
			if i % j == 0:
				break
			j += 1
		else:
			j = i
			while j <= n:
				result.append(j)
				j *= i
	print(len(result))
	print(' '.join((str(i) for i in result)))
main()


n = int(input())
primo = [1] * (n + 1)
primo[0] = 0
primo[1] = 0
for i in range(2, n + 1):
	if primo[i] == 1:
		for j in range(i * i, n + 1, i):
			primo[j] = 0
aux = []
for j in range(2, n + 1):
	if primo[j] == 1:
		aux.append(j)
		x = 2
		while j ** x <= n:
			aux.append(j ** x)
			x += 1
print(len(aux))
print(*aux)


def primes(n):
	sieve = set(range(3, n + 1, 2))
	if n >= 2:
		sieve.add(2)
	for i in range(3, int(n ** 0.5) + 1, 2):
		if i in sieve:
			sieve -= set(range(2 * i, n + 1, i))
	return sieve
n = int(input())
res = []
for i in primes(n):
	k = i
	while k <= n:
		res.append(str(k))
		k *= i
print(len(res))
print(' '.join(res))


n = int(input())

def is_prime(x):
	if x == 2:
		return True
	if x == 1 or x % 2 == 0:
		return False
	i = 3
	while i * i <= x:
		if x % i == 0:
			return False
		i += 1
	return True
ans = []
for i in range(2, n + 1):
	if is_prime(i):
		j = i
		while j <= n:
			ans.append(j)
			j *= i
print(len(ans))
print(' '.join(map(str, ans)))


def crivo(length):
	result = [1] * length
	(result[0], result[1]) = (0, 0)
	for i in range(2, length, 1):
		if result[i] == 1:
			for j in range(i * 2, length, i):
				result[j] = 0
	return result
n = int(input())
aux = crivo(n + 1)
result = []
for i in range(n + 1):
	if aux[i] == 1:
		power = 1
		while i ** power <= n:
			result.append(i ** power)
			power += 1
print(len(result))
print(' '.join(map(str, result)))


x = int(input())
primos = [True] * (x + 1)
p = 2
res = ''
while p * p <= x and x != 1 and (x != 2):
	if primos[p]:
		for i in range(p * p, x + 1, p):
			primos[i] = False
	p += 1
for primo in range(x + 1):
	if primo == 0 or primo == 1:
		continue
	if primos[primo]:
		(p, aux) = (primo, primo)
		while p <= x:
			res += '%i ' % p
			p *= aux
print(len(res.split()))
print(res[:len(res)])


import math

def is_prime(n):
	if n < 4:
		return True
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
ans = []
for i in range(2, n + 1):
	if is_prime(i):
		p = i
		while p <= n:
			ans.append(p)
			p = p * i
print(len(ans))
for i in ans:
	print(i, end=' ')
print()


s = [1] * 1001
i = 2
while i * i < 1001:
	if s[i]:
		for j in range(i * i, 1001, i):
			s[j] = 0
	i += 1
x = int(input())
lol = []
for i in range(2, x + 1):
	if s[i]:
		k = i
		while k <= x:
			lol.append(k)
			k *= i
print(len(lol))
print(*lol)


def prime(n):
	prime = [1] * (n + 1)
	prime[0] = prime[1] = 0
	quest = []
	for i in range(2, n + 1):
		if prime[i] == 1:
			for c in range(i * i, n + 1, i):
				prime[c] = 0
		if prime[i] == 1:
			quest.append(i)
	return quest
n = int(input())
questions = prime(n)
if n == 1:
	print(len(questions))
else:
	e = 0
	i = 1
	num = questions[e]
	saida = []
	while e <= n:
		num *= i
		if num <= n:
			saida.append(num)
			i = questions[e]
		else:
			e += 1
			if len(questions) == e:
				break
			num = questions[e]
			i = 1
	print(len(saida))
	for j in saida:
		print(j, end=' ')


import math
from decimal import *
import random

def sieve(n):
	mrk = [1] * (n + 1)
	(mrk[0], mrk[1]) = (0, 0)
	for i in range(2, int(math.sqrt(n)) + 2):
		if mrk[i]:
			for j in range(i * 2, n + 1, i):
				mrk[j] = 0
	ans = []
	for i in range(n + 1):
		if mrk[i]:
			ans.append(i)
	return ans
pfs = sieve(1000)
n = int(input())
pnt = 0
mult = 0
ans = []
for i in range(n):
	if pnt < len(pfs):
		val = int(pfs[pnt])
		while val <= n:
			ans.append(str(val))
			val *= pfs[pnt]
		pnt += 1
print(len(ans))
print(' '.join(ans))


from math import *

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
ans = []
for i in range(2, n + 1):
	if isPrime(i) == 1:
		ans.append(i)
		k = i
		while k * i <= n:
			k *= i
			ans.append(k)
print(len(ans))
print(*ans)


import math, sys, bisect, heapq, os
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
from functools import lru_cache
int1 = lambda x: int(x) - 1

def input():
	return sys.stdin.readline().rstrip('\r\n')
aj = lambda : list(map(int, input().split()))

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])

def SieveOfEratosthenes(n):
	Z = []
	prime = [True for i in range(n + 1)]
	p = 2
	prime[0] = prime[1] = False
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
pri = SieveOfEratosthenes(10000)

def solve():
	(n,) = aj()
	if n == 1:
		print(0)
	else:
		Ans = []
		s = set()
		for i in range(2, n + 1):
			if pri[i]:
				Ans.append(i)
				s.add(i)
				r = i
				while r * i <= n:
					r *= i
					if not r in s:
						s.add(r)
						Ans.append(r)
		print(len(Ans))
		print(*Ans)
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
solve()


n = int(input())

def sieve():
	out = []
	aux = (n + 1) * [True]
	aux[0] = False
	aux[1] = False
	p = 2
	while p * p <= n:
		if aux[p]:
			for i in range(p * p, n + 1, p):
				aux[i] = False
		p += 1
	for p in range(n + 1):
		if aux[p]:
			i = p
			while i <= n:
				out.append(i)
				i *= p
	return out
out = sieve()
print(len(out))
print(' '.join([str(x) for x in out]))


def gen_prime():
	num = [0 for i in range(10 ** 3 + 1)]
	num[2] = 1
	num[3] = 1
	for i in range(4, 10 ** 3 + 1):
		isprime = True
		for j in range(2, int(i ** 0.5) + 1):
			if num[j]:
				if not i % j:
					isprime = False
					break
		if isprime:
			num[i] = 1
	prime = []
	for i in range(2, 10 ** 3 + 1):
		if num[i]:
			prime.append(i)
	return prime
n = int(input())
prime = gen_prime()
div = []
i = 0
while i < len(prime):
	for j in range(1, 10):
		if prime[i] ** j > n:
			break
		div.append(prime[i] ** j)
	i += 1
print(len(div))
for i in range(len(div)):
	print(div[i], end=' ')
print()


def main():
	n = int(input())
	dct = {}
	for i in range(2, n + 1):
		lst = checker(i)
		for j in lst:
			if j in dct:
				if lst[j] > dct[j]:
					dct[j] = lst[j]
			else:
				dct[j] = lst[j]
	res = ''
	k = 0
	for i in dct:
		for j in range(dct[i]):
			k += 1
			res += ' ' + str(i ** (j + 1))
	return str(k) + '\n' + res[1:]

def checker(n):
	res = {}
	while n > 1:
		for i in range(2, int(n) + 1):
			if n % i == 0:
				if i in res:
					res[i] += 1
				else:
					res[i] = 1
				n = n / i
				break
	return res
print(main())


n = int(input())
isc = [False] * (n + 1)
p = []
ans = []
for i in range(2, n + 1):
	if not isc[i]:
		p.append(i)
		j = i
		while j <= n:
			ans.append(j)
			j *= i
	for j in p:
		if i * j > n:
			break
		isc[i * j] = True
		if i % j == 0:
			break
print(len(ans))
print(*ans)


def prime(n):
	prime = [True] * (n + 1)
	i = 2
	while i <= n:
		for j in range(2 * i, n + 1, i):
			prime[j] = False
		i += 1
	return prime
n = int(input())
p = prime(n)
arr = []
for i in range(2, n + 1):
	if p[i]:
		for j in range(1, n + 1):
			k = pow(i, j)
			if k <= n:
				arr.append(k)
			else:
				break
print(len(arr))
for i in arr:
	print(i, end=' ')


import sys
import math
import itertools
import functools
import collections
import operator

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
n = ii()
ans = []
for i in range(n + 1):
	if prime(i):
		t = 1
		while i ** t <= n:
			ans.append(i ** t)
			t += 1
print(len(ans))
print(*ans)


import sys, math
input = sys.stdin.readline

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input().strip()

def listStr():
	return list(input().strip())
import collections as col
import math

def primes(n):
	sieve = [True] * n
	z = int(n ** 0.5) + 1
	for i in range(3, z, 2):
		if sieve[i]:
			sieve[i * i::2 * i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [i for i in range(3, n, 2) if sieve[i]]

def solve():
	N = getInt()
	if N == 1:
		print(0)
		return
	P = primes(N + 1)
	ans = []
	for p in P:
		power = 1
		while p ** power <= N:
			ans.append(p ** power)
			power += 1
	print(len(ans))
	print(*ans)
	return
solve()


n = int(input())
arr = []
for i in range(2, n + 1):
	isPrime = True
	for j in range(2, i):
		if i % j == 0:
			isPrime = False
			break
	if isPrime:
		c = 1
		while i ** c <= n:
			arr.append(str(i ** c))
			c += 1
print(len(arr))
print(' '.join(arr))


def sieve(n):
	primes = [1] * n
	for i in range(2, int(n ** 0.5) + 1):
		if primes[i] == 1:
			for j in range(2 * i, n, i):
				primes[j] = 0
	return primes
n = int(input())
arr = sieve(n + 2)
cnt = 0
ans = []
for i in range(2, len(arr)):
	if arr[i]:
		x = i
		while n // x > 0:
			ans.append(x)
			x *= i
print(len(ans))
print(*ans)


n = int(input())
aux = [0] * (n + 1)
primes = []
for i in range(2, n + 1):
	if aux[i] == 0:
		primes.append(i)
		t = i
		for j in range(i, n + 1, i):
			aux[j] = 1
			if j / i == t:
				primes.append(j)
				t = j
print(len(primes))
print(' '.join(map(str, primes)))


def prog():
	n = int(input())
	primes = [True for i in range(n + 1)]
	for p in range(2, int(n ** 0.5) + 1):
		if primes[p]:
			for num in range(p ** 2, n + 1, p):
				primes[num] = False
	sequence = []
	for num in range(2, n + 1):
		if primes[num] == True:
			num_pow = num
			while num_pow <= n:
				sequence.append(str(num_pow))
				num_pow *= num
	print(len(sequence))
	print(' '.join(sequence))
prog()


from collections import Counter

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	for p in range(n + 1):
		if prime[p]:
			yield p

def main():
	n = int(input())
	asked = []
	for p in sieve(n):
		i = 1
		pp = p ** i
		while pp <= n:
			asked.append(pp)
			i += 1
			pp = p ** i
	print(len(asked))
	print(*asked)
main()


from math import sqrt, pow, log, log2, log10, exp
from copy import deepcopy

def read_ints():
	return list(map(int, input().split()))

def read_int():
	return read_ints()[0]

def read_floats():
	return list(map(float, input().split()))

def read_float():
	return read_floats()[0]

def one_dim_array(value, n):
	return [deepcopy(value) for x in range(n)]

def two_dim_array(value, n, m):
	return [[deepcopy(value) for x in range(m)] for x in range(n)]

def is_prime(n):
	if n == 2:
		return True
	if n % 2 == 0:
		return False
	for i in range(3, int(sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def tf_to_yn(b):
	return 'YES' if b else 'NO'
n = read_int()
res = []
for x in range(2, n + 1):
	if is_prime(x):
		e = x
		while e <= n:
			res.append(e)
			e *= x
print(len(res))
print(' '.join(map(str, res)))


def crivo(n):
	prime = [True for x in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	resp = []
	for i in range(2, n + 1):
		if prime[i]:
			resp.append(i)
	return resp
n = int(input())
aux = 2
resp = []
for e in crivo(n):
	i = 1
	while e ** i <= n:
		resp.append(e ** i)
		i += 1
print(len(resp))
for e in resp:
	print(e, end=' ')


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]

def prime(n):
	pr = [True] * (n + 1)
	pr[1] = False
	p = 2
	while p * p <= n:
		if pr[p] == True:
			for j in range(p * p, n + 1, p):
				pr[j] = False
		p += 1
	return [i for i in range(2, len(pr)) if pr[i]]
primes = prime(3000)
n = Int()
ind = bisect_right(primes, n)
ans = []
for i in range(ind + 1):
	k = 1
	while primes[i] ** k <= n:
		ans.append(primes[i] ** k)
		k += 1
print(len(ans))
print(*ans)


def prime(n):
	i = 2
	f = True
	while i * i <= n:
		if n % i == 0 and f:
			f = False
		i += 1
	return f

def all_prime(n):
	result = []
	for i in range(2, n + 1):
		if prime(i):
			result.append(i)
	return result
n = int(input())
array = all_prime(n)
answer = []
for i in array:
	t = 1
	while i ** t <= n:
		answer.append(i ** t)
		t += 1
if len(answer) == 0:
	print(0)
else:
	print(len(answer))
	print(*answer)


ls = [True] * 1004
n = int(input())
primes = []
for i in range(2, n + 1):
	if ls[i]:
		primes.append(i)
		for j in range(2 * i, n + 1, i):
			ls[j] = False
lst = []
for prime in primes:
	p = prime
	while p <= n:
		lst.append(p)
		p *= prime
print(len(lst))
for el in lst:
	print(el, end=' ')


n = int(input())
prime = [True] * (n + 2)
prime[0] = False
prime[1] = False
pr = []
for i in range(2, n + 1):
	if prime[i]:
		pr.append(i)
		for j in range(2 * i, n + 1, i):
			prime[j] = False
ch = []
for p in pr:
	j = 1
	while p ** j <= n:
		ch.append(p ** j)
		j += 1
print(len(ch))
print(*ch)


def isPrime(i):
	if i == 2:
		return True
	for k in range(2, i):
		if i % k == 0:
			return False
	return True
n = int(input())
cnt = 0
ans = []
if n == 1:
	print(0)
	print('')
else:
	for i in range(2, n + 1):
		if isPrime(i):
			k = i
			while k <= n:
				cnt += 1
				ans.append(k)
				k = k * i
	print(cnt)
	print(' '.join(map(str, ans)))


import sys
import collections
from collections import Counter
import itertools
import math
import timeit

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
n = ii()
p = sieve(n)
res = []
for i in p:
	t = i
	while t <= n:
		res.append(t)
		t *= i
print(len(res))
prr(res)


def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num
primes = SieveOfEratosthenes(1001)
n = int(input())
ask = []
for i in primes:
	if i <= n:
		j = 1
		while i ** j <= n:
			ask.append(i ** j)
			j += 1
print(len(ask))
print(*ask)


def crivo_Eratostenes(maiorValor):
	lista = [True] * maiorValor
	i = 2
	while i < maiorValor:
		if lista[i] == True:
			j = i * i
			while j < maiorValor:
				lista[j] = False
				j += i
		i += 1
	return lista
maiorValor = 1001
ehPrimo = crivo_Eratostenes(maiorValor)
num = int(input())
resultado = []
i = 2
while i <= num:
	if ehPrimo[i]:
		j = 1
		while i ** j <= num:
			resultado.append(i ** j)
			j += 1
	i += 1
print(len(resultado))
print(*resultado)