#include using namespace std; int main(){ int n, i, j; int k = 0; int f = 1; cin >> n; for( i = 2 ; i <= n ; i = i + 1 ){ f = 1; for( j = 2 ; j < i ; j = j + 1 ){ if( i % j == 0 ) f = 0; } if( f == 1 ) k += i; } cout << k << endl; return 0; }