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(); map.put(0L, 1L); System.out.println(get(n)); } static long get(long x) { if (!map.containsKey(x)) { map.put(x, get(x / 3) + get(x / 5)); } return map.get(x); } }