import math

price = 0
while True:
	try:
		line = input()
		if line[0] == '|':
			price += len(line) * 42
		else:
			a, b = line.split(',-')
			if len(b) == 0:
				price += int(a)
			else:
				price += int(a) * len(b)
	except:
		break
print('{},-'.format(math.ceil(price / 10) * 10))

