Pagini recente » Cod sursa (job #1799833) | Cod sursa (job #2985872) | Cod sursa (job #2847425) | Cod sursa (job #2114709) | Cod sursa (job #1917308)
# include <bits/stdc++.h>
# define maxn 500001
# define ll long long
# define clock (clock() * 1000.0 / CLOCKS_PER_SEC)
# define rc(s) return cout << s,0
# define _ ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
# define pb push_back
# define mp make_pair
//# define int ll
using namespace std;
const int inf = INT_MAX;
bool p[2000001];
int n;
int ans;
int32_t main(){_
freopen("ciur.in","r",stdin);
freopen("ciur.out","w",stdout);
cin >> n;
memset(p,1,sizeof(p));
for(int i = 2;i<=n;i++)
if(p[i])
{
ans++;
for(int j = i * 2;j <= n;j += i) p[j] = 0;
}
rc(ans);
}