#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF_LL (ll)1e18 #define INF (int)1e9 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(x) x.begin(),x.end() using ll = long long; using PII = pair; const double eps = 1e-10; templateinline void chmin(A &a, B b){if(a > b) a = b;} templateinline void chmax(A &a, B b){if(a < b) a = b;} ll N; map dp; ll dfs(ll x){ if(dp[x] != 0) return dp[x]; if(x == 0) return 1; return dp[x] = dfs(x/3)+dfs(x/5); } int main(void){ cin.tie(0); ios::sync_with_stdio(false); cin >> N; cout << dfs(N) << endl; }