#include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0;i<(n);++i) #define REPS(i,s,t) for(int i=(s);i<(t);++i) #define SUMV(v) (accumulate(v.begin(),v.end(),0.0)) #define INF 2000000007 #define MOD 998244353 #define MAX 100005 typedef unsigned int uint; typedef unsigned long long int ull; typedef long long int ll; //uint dp[MAX]; map dp; uint fun(ll n){ if(n==0) return 1; uint a,b; auto itr = dp.find(n/3); if(itr != dp.end()){ a = itr->second; }else{ a = fun(n/3); dp[n/3] = a; } auto itr2 = dp.find(n/5); if(itr2 != dp.end()){ b = itr2->second; }else{ b = fun(n/5); dp[n/5] = b; } return a+b; } int main(){ ll N;cin>>N; dp[0]=1;dp[1]=2; cout << fun(N) << endl; return 0; }