import java.math.BigInteger;
import java.util.Scanner;
public class Main {
final static int MAXN = 10;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int L = sc.nextInt();
int sum = 0;
int ans = 0;
BigInteger aa;
for (int i = 2; ; i++) {
aa = BigInteger.valueOf(i);
// int 转换为 BigInteger
if (aa.isProbablePrime(1)) {
// 判断素数,certainty = 1,保证百分百判断成功
sum += aa.intValue();
// BigInteger 转换为 int
if (sum <= L) {
System.out.println(aa.intValue());
ans ++;
}
else {
break;
}
}
}
System.out.print(ans);
sc.close();
}
}