#include int main(void) { int N, sum = 0,check; scanf("%d", &N); for (int i = 2; i <= N; i++) { check = 1; for (int j = 2; j < i; j++) { if (i%j == 0) { check = 0; break; } } if (check) { sum += i; } } printf("%d", sum); }