import java.util.*; public class Main { static HashMap map = new HashMap<>(); public static void main (String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); System.out.println(getValue(n)); } static long getValue(long x) { if (x == 0) { return 1; } if (map.containsKey(x)) { return map.get(x); } long ans = getValue(x / 3) + getValue(x / 5); map.put(x, ans); return ans; } }