#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector VI; typedef vector VL; typedef vector VVL; typedef vector VVI; typedef pair P; typedef pair PL; map mp; ll calc(ll x){ if (x == 0) return 1; if (mp.count(x)) return mp[x]; ll ret = calc(x / 3) + calc(x / 5); return mp[x] = ret; } int main() { ll n; cin >> n; cout << calc(n) << endl; return 0; }