n = int(input()) def divisor(n: int) -> list: r = [] for i in range(1, int(n ** 0.5) + 1): if n % i != 0: continue r.append(i) if i * i != n: r.append(n // i) return sorted(r) print(n - len(divisor(n)))