#include #define rep(i,n) for(int i=0;i ; using pll = pair; const ll INF = 1e18; const int MOD = 1000000007; const int MX = 1e9; map mp; ll f(ll x){ if(mp.count(x) > 0) return mp[x]; if(x==0) return 1; else{ return mp[x] = f(x/3) + f(x/5); } } int main(){ ll n; cin >> n; cout << f(n) << endl; return 0; }