import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int sum = 0; for(int i = 1; i <= N; i++) { if(isPrime(i)) { sum += i; } } scan.close(); System.out.println(sum); } public static boolean isPrime(long n) { if(n == 1) { return false; } for(long i = 2; i <= (int)Math.sqrt(n); i++){ if(n % i == 0) { return false; } } return true; } }