#include using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b sieve(int n){ vector ret(n+1,true); ret[0]=false; if(n>0) ret[1]=false; for(int i=2;i*i<=n;i++){ if(!ret[i]) continue; for(int j=i*2;j<=n;j+=i) ret[j]=false; } return ret; } ll cnt[300000],ans; signed main(){ cin.tie(0); ios::sync_with_stdio(0); auto isp=sieve(300000); vector ps; rep(i,300000)if(isp[i])ps.push_back(i); int n;cin>>n; for(int i=0;ps[i]<=n;i++){ int c=ps[i]; rep(j,ps.size()){ int sum=ps[j]; if(sum-c>=0) ans+=cnt[sum-c]; } rep(j,i) cnt[c+ps[j]]++; } cout<