#pragma GCC optimize ("-O3","unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define REVERSE(v,n) reverse(v,v+n); #define VREVERSE(v) reverse(v.begin(), v.end()); #define ll long long #define pb(a) push_back(a) #define m0(x) memset(x,0,sizeof(x)) #define print(x) cout< inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } int MOD = (ll)1000000000 + 7; const ll INF = 1e17; const double pi = acos(-1); const double EPS = 1e-10; typedef pairP; const int MAX = 200020; map mp; ll f(int n) { if (n == 0)return 1; if (n == 1)return 2; if (mp[n] != 0)return mp[n]; mp[n / 3] = f(n / 3); mp[n / 5] = f(n / 5); return f(n / 3) + f(n / 5); } signed main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; print(f(N)); }