埃氏筛模板
n=int(input())
def get_premi(max_val):
v=[1]*(max_val+1)
for x in range(2,max_val+1):
if v[x]:
for i in range(x*x,max_val+1,x):
v[i]=0
premi=[i for i in range(2,max_val+1) if v[i]]
return premi
print(get_premi(n))