m = int(input()) count = 0 for i in range(2, m): j = 1 for k in range(2, int(i**(1/2) + 1), 1): if i % k == 0: # 一次找出俩因子 if i // k == k: j += k else: j += k + i // k if i == j: count += 1 print(count)