mod = 998244353 def main(): import sys input = sys.stdin.readline NMAX = 4 * 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, NMAX + 1): if is_prime[p]: prime_list.append(p) ans = [] M = int(input()) i = 0 for lv in range(30, 1, -1): k = 2 ** lv - lv - 1 if M >= k: M -= k p = prime_list[i] i += 1 for _ in range(lv): ans.append(p * prime_list.pop()) for _ in range(M): p = prime_list[i] i += 1 ans.append(p * prime_list.pop()) ans.append(p * prime_list.pop()) print(len(ans)) print(*ans) if __name__ == '__main__': main()