CCF模拟题——跳一跳

// An highlighted block
steps=list(map(int,input().split()))
n=len(steps)
scores=[]
for i in steps:
scores.append(i)
for i in range(n):
if i>0 and steps[i] == 2 and steps[i-1] == 2:
scores[i]=scores[i-1]+2
score=0
for i in scores:
score+=i
print(score)