#include #include using namespace std; map mp; long long func(long long N){ if(mp.find(N) != mp.end()) return mp[N]; return mp[N] = func(N/3) + func(N/5); } int main(){ mp[0] = 1; long long N; cin >> N; cout << func(N) << endl; }