#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; templateusing min_priority_queue = priority_queue, greater>; const ll MOD = 1e9 + 7; const ll inf = 1LL << 60; #define all(x) (x).begin(),(x).end() #define puts(x) cout << x << endl; #define rep(i,m,n) for(ll i = m;i < n;++i) #define pb push_back #define fore(i,a) for(auto &i:a) #define rrep(i,m,n) for(ll i = m;i >= n;--i) #define INF INT_MAX/2 vectorpr; bool prime(ll n) { if (n == 1) { return false; } for (ll i = 2; i*i <= n; i++) { if (n%i == 0) { return false; } } return true; } int main() { int n; cin >> n; for (int i = 1; i*i <= 1e6; i++) { if (prime(i))pr.pb(i); } int ans = 0; fore(x,pr) { if (x > n)break; else if (x == 2) { ans++; } else { if (prime(x*x - 2) && x*x - 2 <= n) { ans += 2; } } } cout << ans << endl; return 0; }