#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { map Prime; for (int i = 2; i <= 1000; i++) { int D = pow(i, 0.5); int count = 0; for (int j = 2; j <= D; j++) { if (i % j == 0)count++; } if (count == 0)Prime[i]++; } int N; cin >> N; int answer = 0; for (int i = 2; i <= N; i++) { if (Prime[i] > 0)answer=answer+i; } cout << answer; }