#include using namespace std; #define pb push_back #define all(x) (x).begin(),(x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") #define Yes() printf("Yes\n") #define No() printf("No\n") #define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w #define int long long //typedef long long ll; typedef vector vb; typedef vector vi; typedef vector vvb; typedef vector vvi; typedef pair P; template T &chmin(T &a, const T &b) { return a = min(a, b); } template T &chmax(T &a, const T &b) { return a = max(a, b); } const int INF=1e+9; const double EPS=1e-9; const int MOD=1000000007; const int dx[]={1,0,-1,0},dy[]={0,-1,0,1}; map mp; int calc(int x){ if(!x) return 1; if(mp[x]) return mp[x]; return mp[x] = calc(x / 3) + calc(x / 5); } signed main(){ int n; cin >> n; cout << calc(n) << endl; return 0; }