Pagini recente » Cod sursa (job #2709412) | Cod sursa (job #2435283) | Cod sursa (job #715059) | Cod sursa (job #826832) | Cod sursa (job #3217612)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(), v.end()
ll ceil2(ll a, ll b) {
return (a + b - 1) / b;
}
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
void solve(){
ll n;cin>>n;
ll f[2000005];memset(f,0,sizeof(f));
ll ans=0;
for(int i=2; i<=n; i++){
if(!f[i]){
ans++;
ll temp=2*i;
while(temp<=n){
f[temp]++;
temp+=i;
}
}
}
cout<<ans;
}
int main(){
freopen("ciur.in", "r", stdin);
freopen("ciur.out", "w", stdout);
ios_base::sync_with_stdio(false); cin.tie(NULL);
// ll t;cin>>t;while(t--){solve();cout<<endl;}
solve();
}