方法1:python

while True:
    try:
        n = int(input())
        num = 0
        for j in range(n):
            m = j+1
            L = []
            for i in range(m//2):#找出真因子
                if m % (i+1)==0:
                    L.append(i+1)
            if sum(L) == m:
                # print(m)
                # print(L)
                num+=1
        print(num)
    except:
        break