#include using namespace std; typedef long long ll; bool isprime(int n) { if (n < 2) return false; if (n == 2) return true; for (int i = 3; i*i <= n; i += 2) { if (n % i == 0) return false; } return true; } int main() { int n; cin >> n; int sum = 0; for (int i = 2; i <= n; i++) { if (isprime(i)) sum += i; } cout << sum << endl; return 0; }