#include int main(void) { int n; int sum = 0, k = 0; int prime_number[10000]; scanf("%d", &n); if (n != 1) { for (int i = 2; i <= n; i++) { for (int j = 2; j <= i; j++) { if (j == i) { prime_number[k] = j; k++; } if (i%j == 0) { break; } } } for (int i = 0; i < k; i++) { sum += prime_number[i]; } } printf("%d\n",sum); }