#include using namespace std; using ll = long long; #define FOR(i,a,b) for(ll i=(a);i<(b);++i) #define ALL(v) (v).begin(), (v).end() #define p(s) cout<<(s)< memo; ll f(ll a){ if(a==0) return 1; if(memo.count(a)>0){ return memo[a]; } ll v = f(a/3) + f(a/5); memo[a] = v; return v; } int main(){ cin.tie(0); ios::sync_with_stdio(false); // input ll N; cin >> N; ll ans = f(N); p(ans); return 0; }