num = int(input()) count = 0 for n in range(1, num): p = 0 for m in range(1, n): if n % m == 0: p = p + m if p == n: count += 1 print(count)