#include #include using namespace std; using i32 = int; using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; #define FAST_IO \ ios::sync_with_stdio(false); \ cin.tie(0); const i64 INF = 1001001001001001001; using Modint = atcoder::static_modint<998244353>; int main() { FAST_IO int N; cin >> N; vector a(N + 1, 1); a[0] = 0; vector is_prime(N + 1, true); for (int i = 2; i <= N; i ++) { if (is_prime[i]) { if (1LL * i * i <= N) { for (int j = i * i; j <= N; j += i * i) { a[j] = 0; } } for (int j = i; j <= N; j += i) { is_prime[j] = false; a[j] *= -1; } } } int ans = 0; for (auto v : a) { ans += v; } cout << ans << endl; }