#include using namespace std; int main() { int n; cin >> n; vector primes(0); for (int i = 2; i <= n; ++i) { bool isPrime = true; for (auto j: primes) { if (i % j == 0) { isPrime = false; break; } } if (isPrime) primes.push_back(i); } int ans = 0; for (auto i: primes) { ans += i; } cout << ans << endl; }