# _*_ coding=utf-8 _*_
__author__ = 'SRF'
__date__ = '2018/8/26 9:56'
# 1 没跳到中心
# 2 跳到中心
# 0 没跳到方块上
data = input()
index = 0
count = 1
score = 0
for i in range(len(data)):
if data[i] == '1':
score += 1
count = 1
elif data[i] == '2':
if index != 0 and data[i - 1] == '2':
count += 1
score += 2 * count
else:
break
index += 1
print(score)
CCF Python题解(100分)201803-1 跳一跳
最新推荐文章于 2021-05-17 17:26:33 发布