N = 101 pl = list(range(2,N)) pn = [0]*N for i in range(2, N): pn[i] = pn[i-1] + 1 if pl.count(i) > 0 else pn[i-1] for j in range(pn[i]): if i*pl[j] >= N: break pl.remove(i*pl[j]) if not (i % pl[j]): break while True: try: n = int(input()) print(' '.join(str(i) for i in pl[:pn[n]])) print(n - 1 - pn[n]) except EOFError: break