reList = list( map(int, input().split()) )
output = 0
count = 0
for ele in reList:
if ele == 2:
count += 1
else:
count = 0
if count == 0:
if ele == 1:
output += 1
else:
output += count*2
print(output)
网友评论