class PrimeNumbers: def __init__(self, nmax): self.prime_judgement = [True]*(nmax+1) self.prime_judgement[0] = self.prime_judgement[1] = False for i in range(2, nmax+1): if self.prime_judgement[i]: for j in range(2, nmax//i+1): self.prime_judgement[i*j] = False self.prime_list = [] for i, flag in enumerate(self.prime_judgement): if flag: self.prime_list.append(i) m = int(input()) pn = PrimeNumbers(10**3) r = [1] while r[-1]*2+1 <= m: r.append(r[-1]*2+1) i = 0 ans = {1} while m: while r[-1] > m: r.pop() p = pn.prime_list[i]; j = 1 for _ in range(len(r)): while p*j in ans: j += 1 ans.add(p*j) i += 1; m -= r[-1] print(len(ans)) print(*ans)