def do_line(text):
    if ",-" in text:
        price, text = text.split(",-")
        price = int(price)
    else:
        price = 42

    return price * max(0, len(text))
cnt = 0
while True:
    try:
        cnt += do_line(input())
    except EOFError:
        break

if cnt % 10 != 0:
    cnt -= cnt % 10
    cnt += 10
print(f"{cnt},-")

