def erastotenes(n): is_prime = [True] *(n+1) is_prime[1] = False for p in range(2,n+1): if is_prime[p] == False: continue is_prime[p] = True k = 2 while k * p < (n+1): is_prime[k*p] = False k +=1 return is_prime M = int(input()) P = erastotenes(10 ** 5 + 1) ans = [] for p in range(2,10**5+1): if P[p]: cnt =1 while pow(p,cnt) <=10 ** 5 and pow(2,cnt) -1 <=M: ans.append(pow(p,cnt)) cnt +=1 M-=pow(2,cnt-1) -1 print(len(ans)) print(*ans)