7-2 sdut-列表元素个数的加权和(1)
递归
def sum(n,deep):
sums = 0
# print(deep)
for i in n:
if isinstance(i, list):
sums += sum(i,deep+1)
if isinstance(i, int):
sums += deep
return sums
a = eval(input())
j = 0
print(sum(a,1))