#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; template bool chmax(T &a, const T &b) { if (a bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } map memo; ll f(ll x){ if(memo.count(x) > 0) return memo[x]; if(x == 0) return memo[x] = 1; return memo[x] = f(x/3) + f(x/5); } int main(){ cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; cout << f(n) << endl; }