##
n=int(input())
lst=[]
for i in range(1,n+1):
if str(i).count('2') or str(i).count('0') or str(i).count('1') or str(i).count('9'):
lst.append(i)
print(sum(lst))
主要是字符串内置函数 count()的用法
N=int(input())
lst=list(map(int,input().split()))
count=[]
deep=1
while 2**deep-1<=N:
data_sum=sum(lst[2**(deep-1)-1:2**deep-1])
count.append(data_sum)
deep+=1
a=max(count)
print(count.index(a)+1)