def is_prime(n): if n <= 1: return False elif n <= 3: return True elif n % 2 == 0: return False d = n - 1 s = 0 while d % 2 == 0: d //= 2 s += 1 bases = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37] for a in bases: if a >= n: continue x = pow(a, d, n) if x == 1 or x == n - 1: continue for _ in range(s - 1): x = pow(x, 2, n) if x == n - 1: break else: return False return True def generate_primes(start, end): primes = [] for num in range(start, end + 1): if num >= 2 and is_prime(num): primes.append(num) return primes def solve(N): if N < 1: return 0 count = 0 def backtrack(current_product, min_p, current_x): nonlocal count if current_product > N: return count += 1 R = N // current_product start = min_p end = R + 1 if start > end: return primes = generate_primes(start, end) for p in primes: if (p - 1) > R: continue e = 1 while True: contribution = (p - 1) * (p) ** (e - 1) new_product = current_product * contribution if new_product > N: break new_x = current_x * (p ** e) backtrack(new_product, p + 1, new_x) e += 1 backtrack(1, 2, 1) return count # Read input and output result N = int(input()) print(solve(N))