#遍历就完事了 while True: try: import math def yueshu(x): li = [] for i in range(1,x+1): if x % i == 0: li.append(i) #print(li) del li[-1] if sum(li) == x: return True n = int(input()) count = 0 for i in range(1,n+1): if yueshu(i): count += 1 print(count) except: break