mod = 998244353 def main(): import sys input = sys.stdin.readline NMAX = 10 ** 5 NMAX2 = 3 * 10 ** 3 is_prime = [1] * (NMAX + 1) is_prime[0] = is_prime[1] = 0 for p in range(2, NMAX + 1): if not is_prime[p]: continue for d in range(2, NMAX + 1): if p * d > NMAX: break is_prime[p * d] = 0 prime_list = [] for p in range(2, NMAX2 + 1): if is_prime[p]: prime_list.append(p) prime_list2 = [] for p in range(NMAX2+1, NMAX): if is_prime[p]: prime_list2.append(p) ans = [] M = int(input()) if M == 0: print(1) print(1) exit() i = 0 for lv in range(30, 1, -1): k = 2 ** lv - 1 if M >= k: M -= k p = prime_list[i] i += 1 for _ in range(lv): while prime_list[-1] * p > 10 ** 5: prime_list.pop() ans.append(p * prime_list.pop()) if M <= len(prime_list2): break for i in range(M): p = prime_list2[i] i += 1 ans.append(p) print(len(ans)) print(*ans) if __name__ == '__main__': main()