import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); System.out.println(func(n)); } public static long func(long n) { if(n == 0) return 1; long s = func(n / 3); long t = func(n / 5); return (s + t); } }