#include using namespace std; map mp; long long calc(long long x) { if(x == 0) { return 1; } if(mp.count(x)) { return mp[x]; } return mp[x] = calc(x / 3) + calc(x / 5); } int main(){ ios::sync_with_stdio(false); cin.tie(0); long long n; cin >> n; cout << calc(n) << endl; return 0; }