def Perfect_number(n): factors = [] for i in range(2, int(n ** 0.5) + 1): if n % i == 0: factors.append(i) factors.append(n // i) if n == sum(factors) + 1: return True try: while True: n = int(input()) number = 0 for i in range(2, n + 1): if Perfect_number(i): number += 1 print(number) except EOFErr...