public static void main(String[] args) throws UnsupportedEncodingException {
		Map<String, Double> orderList = new HashMap<String, Double>();
		double result = 0;
		try {
			Scanner fileScanner = new Scanner(new File("input.txt"));
			while(fileScanner.hasNext()){
				String[] tokens = fileScanner.nextLine().split("\\s");
				orderList.put(tokens[0], Double.parseDouble((tokens[1])));
			}
			Scanner fileScanner2 = new Scanner(new File("Order.txt"));
			while(fileScanner2.hasNext()){
				Double productAmount = fileScanner2.nextDouble();
				String product = fileScanner2.next();
				for (Map.Entry<String, Double> e : orderList.entrySet()) {
					if(e.getKey().equals(product)){
						 result += productAmount*e.getValue();
						
					}
				}
			}
			PrintWriter writer = new PrintWriter("Price.txt", "UTF-8");
//			for (Map.Entry<String, Double> e : orderList.entrySet()) {
//				result+=e.getValue();
//			}
			writer.printf("%.1f",result);
			writer.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}