计算完全数的个数
iNOC产品部--完全数计算
http://www.nowcoder.com/questionTerminal/7299c12e6abb437c87ad3e712383ff84
#计算完全数的个数
a = int(input())
if a > 0 and a <= 500000:
list0 = []
for i in range(1, a + 1):
list1 = []
for j in range(1, i):
if i % j == 0:
list1.append(j)
sum = 0
for x in list1:
sum += x
if sum == i:
list0.append(i)
print(len(list0))
else:
print('-1')