/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.io.BufferedReader; import java.io.InputStreamReader; /** * * @author cteam043 */ public class Bill { final int BEER = 42; void run() throws Exception{ double price = 0; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = br.readLine(); while(line!=null){ //System.out.println("read: "+line); if((line.length()==line.lastIndexOf('|')+1)&&(line.charAt(0)=='|')){ price+=line.length()*BEER; }else{ int w = line.indexOf('|'); if(w== -1)w=line.length(); int p = Integer.parseInt(line.substring(0,w-2)); if(line.length()>=w+2){ price+=p*(line.length()-w); }else{ price+=p; } } // System.out.println("new price: "+price); line = br.readLine(); } price /=10; price=Math.ceil(price); price*=10; int price2 = (int)price; System.out.println(price2+",-"); } public static void main(String[] args) throws Exception{ new Bill().run(); } }