import sys
input = sys.stdin.readline
scores = 0
for _ in range(10):
score = int(input())
prev_scores = scores
scores += score
if scores >= 100:
if abs(100 - scores) > abs(100 - prev_scores):
scores = prev_scores
break
print(scores)