import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); int index = 0; int[] prime = new int[n]; int ans = 0; for(int i = 2; i <= n; i++) { boolean isPrime = true; for(int j = 0; j < index; j++) { if(i%prime[j] == 0) { isPrime = false; break; } } if(isPrime) { ans += i; prime[index] = i; index++; } } System.out.println(ans); } }