#include "bits/stdc++.h" #define REP(i,n,N) for(ll i=(n); i<(N); i++) #define RREP(i,n,N) for(ll i=(N-1); i>=n; i--) #define CK(n,a,b) ((a)<=(n)&&(n)<(b)) #define ALL(v) (v).begin(),(v).end() #define p(s) cout<<(s)<> typedef long long ll; using namespace std; const ll mod = 1e9+7; unordered_map dp; ll f(ll n){ if(dp.count(n)) return dp[n]; return dp[n] = f(n/3) + f(n/5); } int main() { ll N; cin>>N; dp[0]=1; p(f(N)); }