#include using namespace std; typedef long long ll; map memo; ll dfs(ll x){ if(memo.count(x))return memo[x]; ll res = dfs(x/3) + dfs(x/5); memo[x] = res; return res; } int main() { ll n; cin >> n; memo[0] = 1; cout << dfs(n) << endl; return 0; }