n = int(input()) start = 1 count = 0 out = []
which = []
for i in range(2, n + 1): while True: if i % start == 0: out.append(start) if i == start: start = 1 #,重置start,重新计算 break start += 1 if sum(out[0:-1]) == out[-1]: count += 1 # which.append(out[-1]) #输出完全数 out.clear() #清空out,重新计算 print(count)