#include<iostream>
#include<utility>
using namespace std;
typedef long long ll;
#define fi(i,a,b) for(int i = a; i <= b; ++i)
#define fr(i,a,b) for(int i = a; i >= b; --i)
#define x first
#define y second
#define int long long
#define sz(x) ((int)(x).size())
#define pb push_back
using pii = pair<int,int>;
//#define DEBUG
int prime[1005];
int f[1005];
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
prime[0] = 2;
int cnt = 1;
for(int i = 3; i <= 1000; i++){
int flag = 0;
for(int j = 2; j <= i / j; j++){
if(i % j == 0) {
flag = 1;
break;
}
}
if(!flag)
prime[cnt++] = i;
}
int tot = 0;
f[0] = 1;
fi(i,0,cnt-1){
for(int j = 0; j <= tot;j++){
if(j + prime[i] <= n){
tot = min(n,j + prime[i]);
f[j+prime[i]] += f[j];
// cout << tot << " " << prime[i] << " " << j << " " << f[j] << endl;
}
}
}
// cout << f[6] << endl;
cout << f[n] << endl;
#ifdef DEBUG
//freopen(D:\in.txt,r,stdin);
#endif
return 0;
}