import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * * @author Single Malt */ public class Bill { static final int BEER_PRICE = 42; /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line; int total = 0; while ((line = br.readLine()) != null) { int n = 0; for (char c: line.toCharArray()) { n += (c == '|') ? 1 : 0; } if (line.startsWith("|")) { total += BEER_PRICE * n; } else if (!line.isEmpty()) { int price = Integer.parseInt(line.substring(0, line.indexOf(','))); total += price * Math.max(1, n); } } if (total % 10 != 0) { total = ((total + 10) / 10) * 10; } System.out.println(total + ",-"); } }