#include "bits/stdc++.h" using namespace std; #define DEBUG(x) cout<<#x<<": "< #define vl vector #define vii vector< vector > #define vll vector< vector > #define vs vector #define pii pair #define pis pair #define psi pair #define pll pair const int inf = 1000000001; const ll INF = 2e18 * 2; #define MOD 1000000007 #define mod 1000000009 #define pi 3.14159265358979323846 #define Sp(p) cout< mp; ll a(ll m) { if (mp[m]) { return mp[m]; } mp[m] = a(m / 3) + a(m / 5); return a(m / 3) + a(m / 5); } int main() { ll n; cin >> n; mp[0] = 1; cout << a(n) << endl; }