import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;

public class Bill {
	public static int count;

	public static Long a, b, c, k;

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s;
		long line = 1;
		long noteValue = 0;
		
		while ((s = br.readLine()) != null) {
			//char[] chars = s.toCharArray();
			
			if (s.charAt(0) == '|') { // rake line
				noteValue += 42 * s.length();
			} else { //priced line
				String valueString = s.split(",")[0];
				long value = Long.parseLong(valueString);
				long barCount = s.length() - (valueString.length() + 2);
				noteValue += value * barCount;
			}
		}
		
		noteValue = (long) Math.ceil(noteValue / 10.0) * 10;
		
		
		System.out.println(noteValue + ",-");

	}
}

